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

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

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

ByteBuf.writeLongLE介绍

[英]Sets the specified 64-bit long integer at the current writerIndex in the Little Endian Byte Order and increases the writerIndex by 8in this buffer.
[中]在当前writerIndex处以小尾端字节顺序设置指定的64位长整数,并在此缓冲区中将writerIndex增加8。

代码示例

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

@Override
public ByteBuf writeLongLE(long value) {
  buf.writeLongLE(value);
  return this;
}

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

@Override
public ByteBuf writeLongLE(long value) {
  buf.writeLongLE(value);
  return this;
}

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

public Buffer appendLongLE(long l) {
 buffer.writeLongLE(l);
 return this;
}

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

/**
 * Write 8 byte fixed length integer to byte buffers.
 * 
 * @see <a href="https://dev.mysql.com/doc/internals/en/integer.html#packet-Protocol::FixedLengthInteger">FixedLengthInteger</a>
 *
 * @param value 8 byte fixed length integer
 */
public void writeInt8(final long value) {
  byteBuf.writeLongLE(value);
  
}

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

/**
 * Write 8 byte fixed length integer to byte buffers.
 * 
 * @see <a href="https://dev.mysql.com/doc/internals/en/integer.html#packet-Protocol::FixedLengthInteger">FixedLengthInteger</a>
 *
 * @param value 8 byte fixed length integer
 */
public void writeInt8(final long value) {
  byteBuf.writeLongLE(value);
  
}

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

/**
 * Sets the specified 64-bit floating point number at the current
 * {@code writerIndex} in Little Endian Byte Order and increases
 * the {@code writerIndex} by {@code 8} in this buffer.
 * If {@code this.writableBytes} is less than {@code 8}, {@link #ensureWritable(int)}
 * will be called in an attempt to expand capacity to accommodate.
 */
public ByteBuf writeDoubleLE(double value) {
  return writeLongLE(Double.doubleToRawLongBits(value));
}

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

@Override
public ByteBuf writeLongLE(long value) {
  byteBuf.writeLongLE(value);
  return this;
}

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

@Override
public ByteBuf writeLongLE(long value) {
  buf.writeLongLE(value);
  return this;
}

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

public void writeSFixed64NoTag(long value) throws IOException {
  buf.writeLongLE(value);
}

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

/**
 * Sets the specified 64-bit floating point number at the current
 * {@code writerIndex} in Little Endian Byte Order and increases
 * the {@code writerIndex} by {@code 8} in this buffer.
 * If {@code this.writableBytes} is less than {@code 8}, {@link #ensureWritable(int)}
 * will be called in an attempt to expand capacity to accommodate.
 */
public ByteBuf writeDoubleLE(double value) {
  return writeLongLE(Double.doubleToRawLongBits(value));
}

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

/**
 * Sets the specified 64-bit floating point number at the current
 * {@code writerIndex} in Little Endian Byte Order and increases
 * the {@code writerIndex} by {@code 8} in this buffer.
 *
 * @throws IndexOutOfBoundsException
 *         if {@code this.writableBytes} is less than {@code 8}
 */
public ByteBuf writeDoubleLE(double value) {
  return writeLongLE(Double.doubleToRawLongBits(value));
}

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

/** Write an double field, including tag, to the stream. */
  public void writeDouble(final int fieldNumber, double value) throws IOException {
    writeTag(fieldNumber, WireFormat.WIRETYPE_FIXED64);
    buf.writeLongLE(Double.doubleToLongBits(value));
  }
}

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

/**
 * Write lenenc integer to byte buffers.
 *
 * @param value lenenc integer
 */
public void writeIntLenenc(final long value) {
  if (value < 0xfb) {
    byteBuf.writeByte((int) value);
    return;
  }
  if (value < Math.pow(2, 16)) {
    byteBuf.writeByte(0xfc);
    byteBuf.writeShortLE((int) value);
    return;
  }
  if (value < Math.pow(2, 24)) {
    byteBuf.writeByte(0xfd);
    byteBuf.writeMediumLE((int) value);
    return;
  }
  byteBuf.writeByte(0xfe);
  byteBuf.writeLongLE(value);
}

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

/**
 * Write lenenc integer to byte buffers.
 * 
 * @see <a href="https://dev.mysql.com/doc/internals/en/integer.html#packet-Protocol::LengthEncodedInteger">LengthEncodedInteger</a>
 *
 * @param value lenenc integer
 */
public void writeIntLenenc(final long value) {
  if (value < 0xfb) {
    byteBuf.writeByte((int) value);
    return;
  }
  if (value < Math.pow(2, 16)) {
    byteBuf.writeByte(0xfc);
    byteBuf.writeShortLE((int) value);
    return;
  }
  if (value < Math.pow(2, 24)) {
    byteBuf.writeByte(0xfd);
    byteBuf.writeMediumLE((int) value);
    return;
  }
  byteBuf.writeByte(0xfe);
  byteBuf.writeLongLE(value);
}

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

/**
 * Write lenenc integer to byte buffers.
 * 
 * @see <a href="https://dev.mysql.com/doc/internals/en/integer.html#packet-Protocol::LengthEncodedInteger">LengthEncodedInteger</a>
 *
 * @param value lenenc integer
 */
public void writeIntLenenc(final long value) {
  if (value < 0xfb) {
    byteBuf.writeByte((int) value);
    return;
  }
  if (value < Math.pow(2, 16)) {
    byteBuf.writeByte(0xfc);
    byteBuf.writeShortLE((int) value);
    return;
  }
  if (value < Math.pow(2, 24)) {
    byteBuf.writeByte(0xfd);
    byteBuf.writeMediumLE((int) value);
    return;
  }
  byteBuf.writeByte(0xfe);
  byteBuf.writeLongLE(value);
}

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

@Override
protected Object encodeCommand(Command command) {
  if (command.getType().equals(Command.TYPE_OUTPUT_CONTROL)) {
    ByteBuf buf = Unpooled.buffer();
    buf.writeLongLE(Long.parseLong(getUniqueId(command.getDeviceId())));
    buf.writeShortLE(1 + 1 + 3 + 1); // length
    buf.writeByte(BceProtocolDecoder.MSG_OUTPUT_CONTROL);
    buf.writeByte(command.getInteger(Command.KEY_INDEX) == 1 ? 0x0A : 0x0B);
    buf.writeByte(0xFF); // index
    buf.writeByte(0x00); // form id
    buf.writeShortLE(Integer.parseInt(command.getString(Command.KEY_DATA)) > 0 ? 0x0055 : 0x0000);
    buf.writeByte(Checksum.sum(buf.nioBuffer()));
    return buf;
  } else {
    return null;
  }
}

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

@Override
public ByteBuf writeLongLE(long value) {
  buf.writeLongLE(value);
  return this;
}

代码示例来源:origin: io.vertx/vertx-core

public Buffer appendLongLE(long l) {
 buffer.writeLongLE(l);
 return this;
}

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

response.writeLongLE(Long.parseLong(imei));
response.writeShortLE(2);
response.writeByte(MSG_STACK_COFIRM);

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

/**
 * Sets the specified 64-bit floating point number at the current
 * {@code writerIndex} in Little Endian Byte Order and increases
 * the {@code writerIndex} by {@code 8} in this buffer.
 * If {@code this.writableBytes} is less than {@code 8}, {@link #ensureWritable(int)}
 * will be called in an attempt to expand capacity to accommodate.
 */
public ByteBuf writeDoubleLE(double value) {
  return writeLongLE(Double.doubleToRawLongBits(value));
}

相关文章

ByteBuf类方法