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

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

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

ByteBuf.readLongLE介绍

[英]Gets a 64-bit integer at the current readerIndexin the Little Endian Byte Order and increases the readerIndexby 8 in this buffer.
[中]获取当前ReaderIndex处的64位整数(以小尾数字节顺序),并在此缓冲区中将ReaderIndex增加8。

代码示例

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

@Override
public long readLongLE() {
  return buf.readLongLE();
}

代码示例来源:origin: apache/incubator-shardingsphere

/**
 * Read 8 byte fixed length integer from byte buffers.
 * 
 * @see <a href="https://dev.mysql.com/doc/internals/en/integer.html#packet-Protocol::FixedLengthInteger">FixedLengthInteger</a>
 *
 * @return 8 byte fixed length integer
 */
public long readInt8() {
  return byteBuf.readLongLE();
}

代码示例来源:origin: apache/incubator-shardingsphere

/**
 * Read 8 byte fixed length integer from byte buffers.
 * 
 * @see <a href="https://dev.mysql.com/doc/internals/en/integer.html#packet-Protocol::FixedLengthInteger">FixedLengthInteger</a>
 *
 * @return 8 byte fixed length integer
 */
public long readInt8() {
  return byteBuf.readLongLE();
}

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

@Override
public long readLongLE() {
  return buf.readLongLE();
}

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

/**
 * Gets a 64-bit floating point number at the current {@code readerIndex}
 * in Little Endian Byte Order and increases the {@code readerIndex}
 * by {@code 8} in this buffer.
 *
 * @throws IndexOutOfBoundsException
 *         if {@code this.readableBytes} is less than {@code 8}
 */
public double readDoubleLE() {
  return Double.longBitsToDouble(readLongLE());
}

代码示例来源:origin: apache/pulsar

/** Read a 64-bit little-endian integer from the stream. */
public long readRawLittleEndian64() throws IOException {
  return buf.readLongLE();
}

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

/**
 * Gets a 64-bit floating point number at the current {@code readerIndex}
 * in Little Endian Byte Order and increases the {@code readerIndex}
 * by {@code 8} in this buffer.
 *
 * @throws IndexOutOfBoundsException
 *         if {@code this.readableBytes} is less than {@code 8}
 */
public double readDoubleLE() {
  return Double.longBitsToDouble(readLongLE());
}

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

@Override
public long readLongLE() {
  return buf.readLongLE();
}

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

@Override
public long readLongLE() {
  return byteBuf.readLongLE();
}

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

/**
 * Gets a 64-bit floating point number at the current {@code readerIndex}
 * in Little Endian Byte Order and increases the {@code readerIndex}
 * by {@code 8} in this buffer.
 *
 * @throws IndexOutOfBoundsException
 *         if {@code this.readableBytes} is less than {@code 8}
 */
public double readDoubleLE() {
  return Double.longBitsToDouble(readLongLE());
}

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

@Override
public long readLongLE() {
  checkReadableBytes(8);
  return buffer.readLongLE();
}

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

@Override
public long readLongLE() {
  checkReadableBytes(8);
  return buffer.readLongLE();
}

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

@Override
public long readLongLE() {
  checkReadableBytes(8);
  return buffer.readLongLE();
}

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

private Object decode(ByteBuf buf, State state, Decoder<?> decoder) throws IOException {
  int keyLen;
  if (isWindows) {
    keyLen = buf.readIntLE();
  } else {
    keyLen = (int) buf.readLongLE();
  }
  ByteBuf keyBuf = buf.readSlice(keyLen);
  Object key = decoder.decode(keyBuf, state);
  return key;
}

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

private Object decode(ByteBuf buf, State state, Decoder<?> decoder) throws IOException {
  int keyLen;
  if (isWindows) {
    keyLen = buf.readIntLE();
  } else {
    keyLen = (int) buf.readLongLE();
  }
  ByteBuf keyBuf = buf.readSlice(keyLen);
  Object key = decoder.decode(keyBuf, state);
  return key;
}

代码示例来源:origin: apache/incubator-shardingsphere

/**
 * Read lenenc integer from byte buffers.
 *
 * @return lenenc integer
 */
public long readIntLenenc() {
  int firstByte = readInt1();
  if (firstByte < 0xfb) {
    return firstByte;
  }
  if (0xfb == firstByte) {
    return 0;
  }
  if (0xfc == firstByte) {
    return byteBuf.readShortLE();
  }
  if (0xfd == firstByte) {
    return byteBuf.readMediumLE();
  }
  return byteBuf.readLongLE();
}

代码示例来源:origin: apache/incubator-shardingsphere

/**
 * Read lenenc integer from byte buffers.
 * 
 * @see <a href="https://dev.mysql.com/doc/internals/en/integer.html#packet-Protocol::LengthEncodedInteger">LengthEncodedInteger</a>
 *
 * @return lenenc integer
 */
public long readIntLenenc() {
  int firstByte = readInt1();
  if (firstByte < 0xfb) {
    return firstByte;
  }
  if (0xfb == firstByte) {
    return 0;
  }
  if (0xfc == firstByte) {
    return byteBuf.readShortLE();
  }
  if (0xfd == firstByte) {
    return byteBuf.readMediumLE();
  }
  return byteBuf.readLongLE();
}

代码示例来源:origin: apache/incubator-shardingsphere

/**
 * Read lenenc integer from byte buffers.
 * 
 * @see <a href="https://dev.mysql.com/doc/internals/en/integer.html#packet-Protocol::LengthEncodedInteger">LengthEncodedInteger</a>
 *
 * @return lenenc integer
 */
public long readIntLenenc() {
  int firstByte = readInt1();
  if (firstByte < 0xfb) {
    return firstByte;
  }
  if (0xfb == firstByte) {
    return 0;
  }
  if (0xfc == firstByte) {
    return byteBuf.readShortLE();
  }
  if (0xfd == firstByte) {
    return byteBuf.readMediumLE();
  }
  return byteBuf.readLongLE();
}

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

@Override
  public Object decode(ByteBuf buf, State state) throws IOException {
    List<Object> result = new ArrayList<Object>();
    int keyLen;
    if (PlatformDependent.isWindows()) {
      keyLen = buf.readIntLE();
    } else {
      keyLen = (int) buf.readLongLE();
    }
    ByteBuf keyBuf = buf.readSlice(keyLen);
    Object key = codec.getMapKeyDecoder().decode(keyBuf, state);
    result.add(key);
    int valueLen;
    if (PlatformDependent.isWindows()) {
      valueLen = buf.readIntLE();
    } else {
      valueLen = (int) buf.readLongLE();
    }
    ByteBuf valueBuf = buf.readSlice(valueLen);
    Object value = codec.getMapValueDecoder().decode(valueBuf, state);
    result.add(value);
    
    if (sync) {
      double syncId = buf.order(ByteOrder.LITTLE_ENDIAN).readDouble();
      result.add(syncId);
    }
    
    return result;
  }
};

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

@Override
  public Object decode(ByteBuf buf, State state) throws IOException {
    List<Object> result = new ArrayList<Object>();
    int keyLen;
    if (PlatformDependent.isWindows()) {
      keyLen = buf.readIntLE();
    } else {
      keyLen = (int) buf.readLongLE();
    }
    ByteBuf keyBuf = buf.readSlice(keyLen);
    Object key = codec.getMapKeyDecoder().decode(keyBuf, state);
    result.add(key);
    int valueLen;
    if (PlatformDependent.isWindows()) {
      valueLen = buf.readIntLE();
    } else {
      valueLen = (int) buf.readLongLE();
    }
    ByteBuf valueBuf = buf.readSlice(valueLen);
    Object value = codec.getMapValueDecoder().decode(valueBuf, state);
    result.add(value);
    
    if (sync) {
      double syncId = buf.order(ByteOrder.LITTLE_ENDIAN).readDouble();
      result.add(syncId);
    }
    
    return result;
  }
};

相关文章

ByteBuf类方法