Java Utililty Methods ByteBuffer Slice

List of utility methods to do ByteBuffer Slice

Description

The list of methods to do ByteBuffer Slice are organized into topic(s).

Method

ByteBufferslicePosition(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;