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

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

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

ByteBuf.writeBoolean介绍

[英]Sets the specified boolean at the current writerIndexand increases the writerIndex by 1 in this buffer.
[中]在当前writerIndex处设置指定的布尔值,并在此缓冲区中将writerIndex增加1。

代码示例

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

@Override
public ByteBuf writeBoolean(boolean value) {
  buf.writeBoolean(value);
  return this;
}

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

@Override
public ByteBuf writeBoolean(boolean value) {
  buf.writeBoolean(value);
  return this;
}

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

@Override
public void writeBoolean(boolean v) throws IOException {
  buffer.writeBoolean(v);
}

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

@Override
public ByteBuf writeBoolean(boolean value) {
  buf.writeBoolean(value);
  return this;
}

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

@Override
public ByteBuf writeBoolean(boolean value) {
  buf.writeBoolean(value);
  return this;
}

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

@Override
public void writeBoolean(boolean v) throws IOException {
  buffer.writeBoolean(v);
}

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

/**
 * Creates a new single-byte big-endian buffer that holds the specified boolean value.
 */
public static ByteBuf copyBoolean(boolean value) {
  ByteBuf buf = buffer(1);
  buf.writeBoolean(value);
  return buf;
}

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

/**
 * Create a new big-endian buffer that holds a sequence of the specified boolean values.
 */
public static ByteBuf copyBoolean(boolean... values) {
  if (values == null || values.length == 0) {
    return EMPTY_BUFFER;
  }
  ByteBuf buffer = buffer(values.length);
  for (boolean v: values) {
    buffer.writeBoolean(v);
  }
  return buffer;
}

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

@Override
public ByteBuf writeBoolean(boolean value) {
  buf.writeBoolean(value);
  return this;
}

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

@Override
public ByteBuf writeBoolean(boolean value) {
  buf.writeBoolean(value);
  return this;
}

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

@Override
public ByteBuf writeBoolean(boolean value) {
  byteBuf.writeBoolean(value);
  return this;
}

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

@Override
public void writeBoolean(boolean v) throws IOException {
  buffer.writeBoolean(v);
}

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

/**
 * Creates a new single-byte big-endian buffer that holds the specified boolean value.
 */
public static ByteBuf copyBoolean(boolean value) {
  ByteBuf buf = buffer(1);
  buf.writeBoolean(value);
  return buf;
}

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

/**
 * Create a new big-endian buffer that holds a sequence of the specified boolean values.
 */
public static ByteBuf copyBoolean(boolean... values) {
  if (values == null || values.length == 0) {
    return EMPTY_BUFFER;
  }
  ByteBuf buffer = buffer(values.length);
  for (boolean v: values) {
    buffer.writeBoolean(v);
  }
  return buffer;
}

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

@Override
public void write(final ByteBuf buffer) {
  buffer.writeByte(DataConstants.BOOLEAN);
  buffer.writeBoolean(val);
}

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

/**
 * Creates a new single-byte big-endian buffer that holds the specified boolean value.
 */
public static ByteBuf copyBoolean(boolean value) {
  ByteBuf buf = buffer(1);
  buf.writeBoolean(value);
  return buf;
}

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

/**
 * Create a new big-endian buffer that holds a sequence of the specified boolean values.
 */
public static ByteBuf copyBoolean(boolean... values) {
  if (values == null || values.length == 0) {
    return EMPTY_BUFFER;
  }
  ByteBuf buffer = buffer(values.length);
  for (boolean v: values) {
    buffer.writeBoolean(v);
  }
  return buffer;
}

代码示例来源:origin: alibaba/Sentinel

@Override
  public void writeTo(FlowRequestData entity, ByteBuf target) {
    target.writeLong(entity.getFlowId());
    target.writeInt(entity.getCount());
    target.writeBoolean(entity.isPriority());
  }
}

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

@Override
  public ByteBuf encode(ByteBuf buf, RelativeEntityPositionMessage message) throws IOException {
    ByteBufUtils.writeVarInt(buf, message.getId());
    buf.writeShort(message.getDeltaX());
    buf.writeShort(message.getDeltaY());
    buf.writeShort(message.getDeltaZ());
    buf.writeBoolean(message.isOnGround());
    return buf;
  }
}

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

@Override
  public ByteBuf encode(ByteBuf buf, CraftRecipeRequestMessage message) throws IOException {
    buf.writeByte(message.getWindowId());
    ByteBufUtils.writeVarInt(buf, message.getRecipeId());
    buf.writeBoolean(message.isMakeAll());
    return buf;
  }
}

相关文章

ByteBuf类方法