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

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

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

ByteBuf.writeDouble介绍

[英]Sets the specified 64-bit floating point number at the current writerIndex and increases the writerIndex by 8in this buffer.
[中]在当前writerIndex处设置指定的64位浮点数,并在此缓冲区中将writerIndex增加8。

代码示例

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

@Override
public ByteBuf writeDouble(double value) {
  buf.writeDouble(value);
  return this;
}

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

@Override
public void writeDouble(double v) throws IOException {
  buffer.writeDouble(v);
}

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

@Override
public ByteBuf writeDouble(double value) {
  buf.writeDouble(value);
  return this;
}

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

public Buffer appendDouble(double d) {
 buffer.writeDouble(d);
 return this;
}

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

@Override
public void writeDouble(double v) throws IOException {
  buffer.writeDouble(v);
}

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

/**
 * Creates a new 8-byte big-endian buffer that holds the specified 64-bit floating point number.
 */
public static ByteBuf copyDouble(double value) {
  ByteBuf buf = buffer(8);
  buf.writeDouble(value);
  return buf;
}

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

/**
 * Create a new big-endian buffer that holds a sequence of the specified 64-bit floating point numbers.
 */
public static ByteBuf copyDouble(double... values) {
  if (values == null || values.length == 0) {
    return EMPTY_BUFFER;
  }
  ByteBuf buffer = buffer(values.length * 8);
  for (double v: values) {
    buffer.writeDouble(v);
  }
  return buffer;
}

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

@Override
public ByteBuf writeDouble(double value) {
  buf.writeDouble(value);
  return this;
}

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

@Override
public void writeDouble(double v) throws IOException {
  buffer.writeDouble(v);
}

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

@Override
public ByteBuf writeDouble(double value) {
  byteBuf.writeDouble(value);
  return this;
}

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

/**
 * Creates a new 8-byte big-endian buffer that holds the specified 64-bit floating point number.
 */
public static ByteBuf copyDouble(double value) {
  ByteBuf buf = buffer(8);
  buf.writeDouble(value);
  return buf;
}

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

/**
 * Create a new big-endian buffer that holds a sequence of the specified 64-bit floating point numbers.
 */
public static ByteBuf copyDouble(double... values) {
  if (values == null || values.length == 0) {
    return EMPTY_BUFFER;
  }
  ByteBuf buffer = buffer(values.length * 8);
  for (double v: values) {
    buffer.writeDouble(v);
  }
  return buffer;
}

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

/**
 * Creates a new 8-byte big-endian buffer that holds the specified 64-bit floating point number.
 */
public static ByteBuf copyDouble(double value) {
  ByteBuf buf = buffer(8);
  buf.writeDouble(value);
  return buf;
}

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

/**
 * Create a new big-endian buffer that holds a sequence of the specified 64-bit floating point numbers.
 */
public static ByteBuf copyDouble(double... values) {
  if (values == null || values.length == 0) {
    return EMPTY_BUFFER;
  }
  ByteBuf buffer = buffer(values.length * 8);
  for (double v: values) {
    buffer.writeDouble(v);
  }
  return buffer;
}

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

@Override
  public void write(final PostgreSQLPacketPayload payload, final Object value) {
    payload.getByteBuf().writeDouble(Double.parseDouble(value.toString()));
  }
}

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

@Override
public PackOutput writeDouble( double value ) throws IOException
{
  ensure( Double.BYTES );
  buffer.writeDouble( value );
  return this;
}

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

@Override
  public ByteBuf encode(ByteBuf buf, VehicleMoveMessage message) throws IOException {
    buf.writeDouble(message.getX());
    buf.writeDouble(message.getY());
    buf.writeDouble(message.getZ());
    buf.writeFloat(message.getYaw());
    buf.writeFloat(message.getPitch());
    return buf;
  }
}

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

@Override
  public ByteBuf encode(ByteBuf buf, EntityTeleportMessage message) throws IOException {
    ByteBufUtils.writeVarInt(buf, message.getId());
    buf.writeDouble(message.getX());
    buf.writeDouble(message.getY());
    buf.writeDouble(message.getZ());
    buf.writeByte(message.getRotation());
    buf.writeByte(message.getPitch());
    buf.writeBoolean(message.isOnGround());
    return buf;
  }
}

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

@Override
  public ByteBuf encode(ByteBuf buf, PlayerPositionLookMessage message) throws IOException {
    buf.writeDouble(message.getX());
    buf.writeDouble(message.getY());
    buf.writeDouble(message.getZ());
    buf.writeFloat(message.getYaw());
    buf.writeFloat(message.getPitch());
    buf.writeBoolean(message.isOnGround());
    return buf;
  }
}

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

@Override
  public ByteBuf encode(ByteBuf buf, PositionRotationMessage message) throws IOException {
    buf.writeDouble(message.getX());
    buf.writeDouble(message.getY());
    buf.writeDouble(message.getZ());
    buf.writeFloat(message.getRotation());
    buf.writeFloat(message.getPitch());
    buf.writeByte(message.getFlags());
    ByteBufUtils.writeVarInt(buf, message.getTeleportId());
    return buf;
  }
}

相关文章

ByteBuf类方法