예제 #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;
 }