read index:0 write index:10 capacity:10 +-------------------------------------------------+ | 0123456789 a b c d e f | +--------+-------------------------------------------------+----------------+ |00000000| 61626364656661626364 |abcdefabcd | +--------+-------------------------------------------------+----------------+ read index:0 write index:5 capacity:5 +-------------------------------------------------+ | 0123456789 a b c d e f | +--------+-------------------------------------------------+----------------+ |00000000| 6162636465 |abcde | +--------+-------------------------------------------------+----------------+ read index:0 write index:5 capacity:5 +-------------------------------------------------+ | 0123456789 a b c d e f | +--------+-------------------------------------------------+----------------+ |00000000| 6661626364 |fabcd | +--------+-------------------------------------------------+----------------+ read index:0 write index:10 capacity:10 +-------------------------------------------------+ | 0123456789 a b c d e f | +--------+-------------------------------------------------+----------------+ |00000000| 31626364656661626364 |1bcdefabcd | +--------+-------------------------------------------------+----------------+
Exception in thread "main" io.netty.util.IllegalReferenceCountException: refCnt: 0 at io.netty.buffer.AbstractByteBuf.ensureAccessible(AbstractByteBuf.java:1454) at io.netty.buffer.AbstractByteBuf.checkIndex(AbstractByteBuf.java:1383) at io.netty.buffer.AbstractByteBuf.checkIndex(AbstractByteBuf.java:1379) at io.netty.buffer.AbstractByteBuf.getByte(AbstractByteBuf.java:355) at io.netty.buffer.AbstractUnpooledSlicedByteBuf.getByte(AbstractUnpooledSlicedByteBuf.java:120) at io.netty.buffer.AbstractByteBuf.getUnsignedByte(AbstractByteBuf.java:368) at io.netty.buffer.ByteBufUtil$HexUtil.appendPrettyHexDump(ByteBufUtil.java:1580) at io.netty.buffer.ByteBufUtil$HexUtil.access$500(ByteBufUtil.java:1420) at io.netty.buffer.ByteBufUtil.appendPrettyHexDump(ByteBufUtil.java:1416) at io.netty.buffer.ByteBufUtil.appendPrettyHexDump(ByteBufUtil.java:1407) at com.redisc.Run.log(Run.java:35) at com.redisc.Run.main(Run.java:24)
read index:0 write index:20 capacity:20 +-------------------------------------------------+ | 0123456789 a b c d e f | +--------+-------------------------------------------------+----------------+ |00000000| 61626364656661626364616263646566 |abcdefabcdabcdef| |00000010| 61626364 |abcd | +--------+-------------------------------------------------+----------------+