List of utility methods to do ByteBuffer Get
boolean | getBoolean(ByteBuffer b) get Boolean return (b.getInt() == 1);
|
boolean | getBoolean(ByteBuffer bb) get Boolean return bb.get() == 1;
|
boolean | getBoolean(ByteBuffer bytes) get Boolean return bytes.slice().get() != 0;
|
boolean | getBoolean(java.nio.ByteBuffer buffer) get Boolean return !((byte) 0 == buffer.get()); |
ByteBuffer | getBuffer(ByteBuffer buffer, int len) Get buffer form buffer byte[] des = new byte[len]; buffer.get(des); ByteBuffer buf = ByteBuffer.allocate(len); buf.put(des); buf.flip(); return buf; |
byte[] | getBufferBytes(ByteBuffer bb) get Buffer Bytes byte[] buffer = bb.array(); byte[] written = new byte[bb.position()]; for (int i = 0; i < written.length; i++) { written[i] = buffer[i]; return written; |
short | getByte(ByteBuffer bb) Get an unsigned byte from the byte buffer. return ((short) (bb.get() & 0xff)); |
short | getByte(ByteBuffer byteBuffer) get Byte return (short) (byteBuffer.get() & BYTE_PADDING); |
short | getByteAsShort(java.nio.ByteBuffer buffer) get Byte As Short return (short) (0xFF & buffer.get()); |
int | getByteLen(ByteBuffer buffer) get Byte Len return 0xff & buffer.get();
|