List of utility methods to do ByteBuffer Slice
ByteBuffer | slicePosition(ByteBuffer base, int position) slice Position int safe = base.position(); base.position(position); ByteBuffer buffer = base.slice(); buffer.order(base.order()); base.position(safe); return buffer; |
byte[] | sliceToByte(ByteBuffer val, int offset, int length) slice To Byte byte[] rlt = new byte[length]; val.get(rlt, offset, length); return rlt; |