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

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

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

ByteBuf.readDouble介绍

[英]Gets a 64-bit floating point number at the current readerIndexand increases the readerIndex by 8 in this buffer.
[中]获取当前readerIndex上的64位浮点数,并在此缓冲区中将readerIndex增加8。

代码示例

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

@Override
public double readDouble() {
  return buf.readDouble();
}

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

@Override
public double readDouble() {
  return buf.readDouble();
}

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

@Override
public double readDouble()
{
  return buf.readDouble();
}

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

@Override
public double readDouble() {
  return buf.readDouble();
}

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

@Override
public double readDouble() {
  return byteBuf.readDouble();
}

代码示例来源:origin: org.mongodb/mongo-java-driver

@Override
public double getDouble() {
  return proxied.readDouble();
}

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

@Override
public double readDouble() {
  checkReadableBytes(8);
  return buffer.readDouble();
}

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

@Override
public double readDouble() {
  checkReadableBytes(8);
  return buffer.readDouble();
}

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

@Override
public Object read(final PostgreSQLPacketPayload payload) {
  return payload.getByteBuf().readDouble();
}

代码示例来源:origin: GlowstoneMC/Glowstone

@Override
public PlayerPositionMessage decode(ByteBuf buffer) throws IOException {
  double x = buffer.readDouble();
  double y = buffer.readDouble();
  double z = buffer.readDouble();
  boolean onGround = buffer.readBoolean();
  return new PlayerPositionMessage(onGround, x, y, z);
}

代码示例来源:origin: GlowstoneMC/Glowstone

@Override
public SpawnLightningStrikeMessage decode(ByteBuf buf) throws IOException {
  int id = ByteBufUtils.readVarInt(buf);
  int mode = buf.readByte();
  double x = buf.readDouble();
  double y = buf.readDouble();
  double z = buf.readDouble();
  return new SpawnLightningStrikeMessage(id, mode, x, y, z);
}

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

@Override
public double readDouble() {
  checkReadableBytes(8);
  return buffer.readDouble();
}

代码示例来源:origin: GlowstoneMC/Glowstone

@Override
public VehicleMoveMessage decode(ByteBuf buffer) throws IOException {
  double x = buffer.readDouble();
  double y = buffer.readDouble();
  double z = buffer.readDouble();
  float yaw = buffer.readFloat();
  float pitch = buffer.readFloat();
  return new VehicleMoveMessage(x, y, z, yaw, pitch);
}

代码示例来源:origin: GlowstoneMC/Glowstone

@Override
public SpawnXpOrbMessage decode(ByteBuf buf) throws IOException {
  int id = ByteBufUtils.readVarInt(buf);
  double x = buf.readDouble();
  double y = buf.readDouble();
  double z = buf.readDouble();
  short count = buf.readShort();
  return new SpawnXpOrbMessage(id, x, y, z, count);
}

代码示例来源:origin: GlowstoneMC/Glowstone

@Override
public EntityTeleportMessage decode(ByteBuf buf) throws IOException {
  int id = ByteBufUtils.readVarInt(buf);
  double x = buf.readDouble();
  double y = buf.readDouble();
  double z = buf.readDouble();
  int rotation = buf.readByte();
  int pitch = buf.readByte();
  boolean ground = buf.readBoolean();
  return new EntityTeleportMessage(id, x, y, z, rotation, pitch, ground);
}

代码示例来源:origin: GlowstoneMC/Glowstone

@Override
public SpawnPlayerMessage decode(ByteBuf buf) throws IOException {
  int id = ByteBufUtils.readVarInt(buf);
  UUID uuid = GlowBufUtils.readUuid(buf);
  double x = buf.readDouble();
  double y = buf.readDouble();
  double z = buf.readDouble();
  int rotation = buf.readByte();
  int pitch = buf.readByte();
  List<Entry> list = GlowBufUtils.readMetadata(buf);
  return new SpawnPlayerMessage(id, uuid, x, y, z, rotation, pitch, list);
}

代码示例来源:origin: GlowstoneMC/Glowstone

@Override
public PlayerPositionLookMessage decode(ByteBuf buffer) throws IOException {
  double x = buffer.readDouble();
  double y = buffer.readDouble();
  double z = buffer.readDouble();
  float yaw = buffer.readFloat();
  float pitch = buffer.readFloat();
  boolean onGround = buffer.readBoolean();
  return new PlayerPositionLookMessage(onGround, x, y, z, yaw, pitch);
}

代码示例来源:origin: GlowstoneMC/Glowstone

@Override
public PositionRotationMessage decode(ByteBuf buffer) throws IOException {
  double x = buffer.readDouble();
  double y = buffer.readDouble();
  double z = buffer.readDouble();
  float rotation = buffer.readFloat();
  float pitch = buffer.readFloat();
  int flags = buffer.readUnsignedByte();
  int teleportId = ByteBufUtils.readVarInt(buffer);
  return new PositionRotationMessage(x, y, z, rotation, pitch, flags, teleportId);
}

代码示例来源: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类方法