List of usage examples for io.netty.buffer CompositeByteBuf readByte
@Override public byte readByte()
From source file:io.grpc.alts.internal.BufUnwrapperTest.java
License:Apache License
@Test public void writableNioBuffers_worksWithComposite() { CompositeByteBuf buf = alloc.compositeBuffer(); buf.addComponent(alloc.buffer(1));/*w w w . ja v a 2 s . c om*/ buf.capacity(1); try (BufUnwrapper unwrapper = new BufUnwrapper()) { ByteBuffer[] internalBufs = unwrapper.writableNioBuffers(buf); Truth.assertThat(internalBufs).hasLength(1); internalBufs[0].put((byte) 'a'); buf.writerIndex(1); assertEquals('a', buf.readByte()); } finally { buf.release(); } }