@Test public void testDecode() { byte[] b = new byte[2048]; new Random().nextBytes(b); ch.writeInbound(wrappedBuffer(b)); assertThat((byte[]) ch.readInbound(), is(b)); }
@Override protected void decode(ChannelHandlerContext ctx, ByteBuf msg, List<Object> out) throws Exception { byte[] array = new byte[msg.readableBytes()]; msg.getBytes(0, array); out.add(array); }
ByteArrayDecoder extends MessageToMessageDecoder<ByteBuf> { @Override protected void decode(ChannelHandlerContext ctx, ByteBuf msg, List<Object> out) throws Exception { byte[] array = new byte[msg.readableBytes()]; msg.getBytes(0, array); out.add(array); } }
ByteArrayDecoder extends MessageToMessageDecoder<ByteBuf> { @Override protected void decode(ChannelHandlerContext ctx, ByteBuf msg, List<Object> out) throws Exception { byte[] array = new byte[msg.readableBytes()]; msg.getBytes(0, array); out.add(array); }  }
ByteArrayDecoder extends MessageToMessageDecoder<ByteBuf> { @Override protected void decode(ChannelHandlerContext ctx, ByteBuf msg, List<Object> out) throws Exception { byte[] array = new byte[msg.readableBytes()]; msg.getBytes(0, array); out.add(array); }   }
ByteArrayDecoder extends MessageToMessageDecoder<ByteBuf> { @Override protected void decode(ChannelHandlerContext ctx, ByteBuf msg, List<Object> out) throws Exception { byte[] array = new byte[msg.readableBytes()]; msg.getBytes(0, array); out.add(array); }    }