// We don't bother with the direction, we only send requests.
header.writeByte(frame.header.version.toInt());
header.writeByte(Header.Flag.serialize(frame.header.flags));
writeStreamId(frame.header.streamId, header, protocolVersion);
header.writeByte(frame.header.opcode);
header.writeInt(frame.body.readableBytes());
return ChannelBuffers.wrappedBuffer(header, frame.body);
}
private void writeStreamId(int streamId, ChannelBuffer header, ProtocolVersion protocolVersion) {
switch (protocolVersion) {