DirectByteBufInStringOutPayload extends AbstractInOutPayload { @Override protected long doOut(WritableByteChannel writableByteChannel) throws IOException { throw new UnsupportedOperationException("Not support"); }  @Override String toString(); static final Cumulator COMPOSITE_CUMULATOR; static final Cumulator MERGE_CUMULATOR; }
@Test(expected = UnsupportedOperationException.class) public void testDoOut() throws IOException { String content = randomString(); DirectByteBufInStringOutPayload payload = new DirectByteBufInStringOutPayload(); payload.startInput(); try (ByteArrayWritableByteChannel channel = new ByteArrayWritableByteChannel()) { ByteBuffer byteBuffer = ByteBuffer.wrap(content.getBytes()); payload.in(Unpooled.wrappedBuffer(byteBuffer)); payload.out(channel); byte[] result = channel.getResult(); Assert.assertEquals(content, new String(result)); } payload.endInput(); }