List of usage examples for io.netty.buffer ByteBuf writeByte
public abstract ByteBuf writeByte(int value);
From source file:com.linecorp.armeria.server.grpc.ArmeriaGrpcServerStreamTest.java
License:Apache License
private static byte[] compressionFrame(byte[] data) { ByteBuf buf = Unpooled.buffer(); buf.writeByte(0); buf.writeInt(data.length);// w ww . ja va 2 s.c om buf.writeBytes(data); return ByteBufUtil.getBytes(buf); }
From source file:com.linecorp.armeria.server.grpc.ArmeriaServerCall.java
License:Apache License
private HttpData serializeTrailersAsMessage(HttpHeaders trailers) { final ByteBuf serialized = ctx.alloc().buffer(); boolean success = false; try {//from w w w. ja v a2s . c o m serialized.writeByte(TRAILERS_FRAME_HEADER); // Skip, we'll set this after serializing the headers. serialized.writeInt(0); for (Map.Entry<AsciiString, String> trailer : trailers) { encodeHeader(trailer.getKey(), trailer.getValue(), serialized); } final int messageSize = serialized.readableBytes() - 5; serialized.setInt(1, messageSize); success = true; } finally { if (!success) { serialized.release(); } } return new ByteBufHttpData(serialized, true); }
From source file:com.lothrazar.cyclicmagic.playerupgrade.PacketSyncExtendedInventory.java
License:Open Source License
@Override public void toBytes(ByteBuf buffer) { buffer.writeByte(slot); buffer.writeInt(playerId); ByteBufUtils.writeItemStack(buffer, itemStack); }
From source file:com.ltln.modules.openflow.core.protocol.ver10.OFBsnPduSlotNumSerializerVer10.java
public static void writeTo(ByteBuf bb, OFBsnPduSlotNum e) { bb.writeByte(toWireValue(e)); }
From source file:com.ltln.modules.openflow.core.protocol.ver10.OFBsnVportStatusSerializerVer10.java
public static void writeTo(ByteBuf bb, OFBsnVportStatus e) { bb.writeByte(U8.t(toWireValue(e))); }
From source file:com.ltln.modules.openflow.core.protocol.ver10.OFFlowRemovedReasonSerializerVer10.java
public static void writeTo(ByteBuf bb, OFFlowRemovedReason e) { bb.writeByte(toWireValue(e)); }
From source file:com.ltln.modules.openflow.core.protocol.ver10.OFPacketInReasonSerializerVer10.java
public static void writeTo(ByteBuf bb, OFPacketInReason e) { bb.writeByte(toWireValue(e)); }
From source file:com.ltln.modules.openflow.core.protocol.ver10.OFPortReasonSerializerVer10.java
public static void writeTo(ByteBuf bb, OFPortReason e) { bb.writeByte(toWireValue(e)); }
From source file:com.ltln.modules.openflow.core.protocol.ver10.OFTypeSerializerVer10.java
public static void writeTo(ByteBuf bb, OFType e) { bb.writeByte(toWireValue(e)); }
From source file:com.ltln.modules.openflow.core.protocol.ver11.OFFlowModCommandSerializerVer11.java
public static void writeTo(ByteBuf bb, OFFlowModCommand e) { bb.writeByte(toWireValue(e)); }