コード例 #1
0
 @Override
 public ByteBuf toByteArray() throws MessageEncodingException {
   ByteBuf buffer = createChannelBufferWithHeader();
   ByteBuf msgBuffer = message.toByteArray();
   byte[] bytes = msgBuffer.array();
   buffer.writeBytes(bytes);
   return buffer;
 }
コード例 #2
0
 @Override
 public ByteBuf toByteArray() throws MessageEncodingException {
   ByteBuf buffer = createChannelBufferWithHeader();
   ByteBuf msgBuffer = message.toByteArray();
   // Could use ByteBuffer instead of byte[], but it's not
   // guaranteed to be same buffer as used in ChannelBuffer
   byte[] bytes = msgBuffer.array();
   buffer.writeBytes(bytes);
   return buffer;
 }