io.netty.buffer.ByteBuf.getUnsignedIntLE()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(229)

本文整理了Java中io.netty.buffer.ByteBuf.getUnsignedIntLE()方法的一些代码示例,展示了ByteBuf.getUnsignedIntLE()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ByteBuf.getUnsignedIntLE()方法的具体详情如下:
包路径:io.netty.buffer.ByteBuf
类名称:ByteBuf
方法名:getUnsignedIntLE

ByteBuf.getUnsignedIntLE介绍

[英]Gets an unsigned 32-bit integer at the specified absolute indexin this buffer in Little Endian Byte Order. This method does not modify readerIndex or writerIndex of this buffer.
[中]获取此缓冲区中指定绝对索引处的无符号32位整数(以小尾数字节顺序)。此方法不修改此缓冲区的readerIndex或writerIndex。

代码示例

代码示例来源:origin: netty/netty

private static long compareUintLittleEndian(
    ByteBuf bufferA, ByteBuf bufferB, int aIndex, int bIndex, int uintCountIncrement) {
  for (int aEnd = aIndex + uintCountIncrement; aIndex < aEnd; aIndex += 4, bIndex += 4) {
    long comp = bufferA.getUnsignedIntLE(aIndex) - bufferB.getUnsignedIntLE(bIndex);
    if (comp != 0) {
      return comp;
    }
  }
  return 0;
}

代码示例来源:origin: netty/netty

@Override
public long getUnsignedIntLE(int index) {
  return buf.getUnsignedIntLE(index);
}

代码示例来源:origin: redisson/redisson

private static long compareUintLittleEndian(
    ByteBuf bufferA, ByteBuf bufferB, int aIndex, int bIndex, int uintCountIncrement) {
  for (int aEnd = aIndex + uintCountIncrement; aIndex < aEnd; aIndex += 4, bIndex += 4) {
    long comp = bufferA.getUnsignedIntLE(aIndex) - bufferB.getUnsignedIntLE(bIndex);
    if (comp != 0) {
      return comp;
    }
  }
  return 0;
}

代码示例来源:origin: redisson/redisson

@Override
public long getUnsignedIntLE(int index) {
  return buf.getUnsignedIntLE(index);
}

代码示例来源:origin: eclipse-vertx/vert.x

public long getUnsignedIntLE(int pos) {
 return buffer.getUnsignedIntLE(pos);
}

代码示例来源:origin: wildfly/wildfly

private static long compareUintLittleEndian(
    ByteBuf bufferA, ByteBuf bufferB, int aIndex, int bIndex, int uintCountIncrement) {
  for (int aEnd = aIndex + uintCountIncrement; aIndex < aEnd; aIndex += 4, bIndex += 4) {
    long comp = bufferA.getUnsignedIntLE(aIndex) - bufferB.getUnsignedIntLE(bIndex);
    if (comp != 0) {
      return comp;
    }
  }
  return 0;
}

代码示例来源:origin: wildfly/wildfly

@Override
public long getUnsignedIntLE(int index) {
  return buf.getUnsignedIntLE(index);
}

代码示例来源:origin: micronaut-projects/micronaut-core

@Override
public long getUnsignedIntLE(int index) {
  return byteBuf.getUnsignedIntLE(index);
}

代码示例来源:origin: netty/netty

@Override
public long getUnsignedIntLE(int index) {
  checkIndex(index, 4);
  return buffer.getUnsignedIntLE(index);
}

代码示例来源:origin: netty/netty

private static long compareUintBigEndianB(
    ByteBuf bufferA, ByteBuf bufferB, int aIndex, int bIndex, int uintCountIncrement) {
  for (int aEnd = aIndex + uintCountIncrement; aIndex < aEnd; aIndex += 4, bIndex += 4) {
    long comp =  bufferA.getUnsignedIntLE(aIndex) - bufferB.getUnsignedInt(bIndex);
    if (comp != 0) {
      return comp;
    }
  }
  return 0;
}

代码示例来源:origin: netty/netty

private static long compareUintBigEndianA(
    ByteBuf bufferA, ByteBuf bufferB, int aIndex, int bIndex, int uintCountIncrement) {
  for (int aEnd = aIndex + uintCountIncrement; aIndex < aEnd; aIndex += 4, bIndex += 4) {
    long comp =  bufferA.getUnsignedInt(aIndex) - bufferB.getUnsignedIntLE(bIndex);
    if (comp != 0) {
      return comp;
    }
  }
  return 0;
}

代码示例来源:origin: redisson/redisson

@Override
public long getUnsignedIntLE(int index) {
  checkIndex(index, 4);
  return buffer.getUnsignedIntLE(index);
}

代码示例来源:origin: redisson/redisson

private static long compareUintBigEndianB(
    ByteBuf bufferA, ByteBuf bufferB, int aIndex, int bIndex, int uintCountIncrement) {
  for (int aEnd = aIndex + uintCountIncrement; aIndex < aEnd; aIndex += 4, bIndex += 4) {
    long comp =  bufferA.getUnsignedIntLE(aIndex) - bufferB.getUnsignedInt(bIndex);
    if (comp != 0) {
      return comp;
    }
  }
  return 0;
}

代码示例来源:origin: redisson/redisson

private static long compareUintBigEndianA(
    ByteBuf bufferA, ByteBuf bufferB, int aIndex, int bIndex, int uintCountIncrement) {
  for (int aEnd = aIndex + uintCountIncrement; aIndex < aEnd; aIndex += 4, bIndex += 4) {
    long comp =  bufferA.getUnsignedInt(aIndex) - bufferB.getUnsignedIntLE(bIndex);
    if (comp != 0) {
      return comp;
    }
  }
  return 0;
}

代码示例来源:origin: wildfly/wildfly

@Override
public long getUnsignedIntLE(int index) {
  checkIndex(index, 4);
  return buffer.getUnsignedIntLE(index);
}

代码示例来源:origin: wildfly/wildfly

private static long compareUintBigEndianB(
    ByteBuf bufferA, ByteBuf bufferB, int aIndex, int bIndex, int uintCountIncrement) {
  for (int aEnd = aIndex + uintCountIncrement; aIndex < aEnd; aIndex += 4, bIndex += 4) {
    long comp =  bufferA.getUnsignedIntLE(aIndex) - bufferB.getUnsignedInt(bIndex);
    if (comp != 0) {
      return comp;
    }
  }
  return 0;
}

代码示例来源:origin: wildfly/wildfly

private static long compareUintBigEndianA(
    ByteBuf bufferA, ByteBuf bufferB, int aIndex, int bIndex, int uintCountIncrement) {
  for (int aEnd = aIndex + uintCountIncrement; aIndex < aEnd; aIndex += 4, bIndex += 4) {
    long comp =  bufferA.getUnsignedInt(aIndex) - bufferB.getUnsignedIntLE(bIndex);
    if (comp != 0) {
      return comp;
    }
  }
  return 0;
}

代码示例来源:origin: traccar/traccar

@Override
protected Object decode(
    ChannelHandlerContext ctx, Channel channel, ByteBuf buf) throws Exception {
  if (buf.readableBytes() < 4) {
    return null;
  }
  long length = buf.getUnsignedIntLE(buf.readerIndex());
  if (length < 1024) {
    if (buf.readableBytes() >= length + 4) {
      buf.readUnsignedIntLE();
      return buf.readRetainedSlice((int) length);
    }
  } else {
    int endIndex = buf.indexOf(buf.readerIndex(), buf.writerIndex(), (byte) 0);
    if (endIndex >= 0) {
      ByteBuf frame = buf.readRetainedSlice(endIndex - buf.readerIndex());
      buf.readByte();
      if (frame.readableBytes() > 0) {
        return frame;
      }
    }
  }
  return null;
}

代码示例来源:origin: traccar/traccar

@Override
protected Object decode(
    ChannelHandlerContext ctx, Channel channel, ByteBuf buf) throws Exception {
  // Check minimum length
  if (buf.readableBytes() < MESSAGE_HEADER) {
    return null;
  }
  // Check for preamble
  boolean hasPreamble = false;
  if (buf.getUnsignedIntLE(buf.readerIndex()) == PREAMBLE) {
    hasPreamble = true;
  }
  // Check length and return buffer
  int length = buf.getUnsignedShortLE(buf.readerIndex() + 6);
  if (buf.readableBytes() >= length) {
    if (hasPreamble) {
      buf.readUnsignedIntLE();
      length -= 4;
    }
    return buf.readRetainedSlice(length);
  }
  return null;
}

代码示例来源:origin: io.netty/netty-buffer

private static long compareUintBigEndianB(
    ByteBuf bufferA, ByteBuf bufferB, int aIndex, int bIndex, int uintCountIncrement) {
  for (int aEnd = aIndex + uintCountIncrement; aIndex < aEnd; aIndex += 4, bIndex += 4) {
    long comp =  bufferA.getUnsignedIntLE(aIndex) - bufferB.getUnsignedInt(bIndex);
    if (comp != 0) {
      return comp;
    }
  }
  return 0;
}

相关文章

ByteBuf类方法