List of utility methods to do ByteBuffer to Int
int | getUShort(ByteBuffer buffer) get U Short return getUShort(buffer, DEFAULT_BYTE_ORDER);
|
int | getUShort(java.nio.ByteBuffer buffer) get U Short return 0xFFFF & buffer.getShort();
|
int | readInt(ByteBuffer buf) read Int if (buf.remaining() < 4) { throw new IOException("Not enough bytes in buffer to read integer"); int ch1 = 0x0000ffff & buf.get(); int ch2 = 0x0000ffff & buf.get(); int ch3 = 0x0000ffff & buf.get(); int ch4 = 0x0000ffff & buf.get(); if ((ch1 | ch2 | ch3 | ch4) < 0) ... |
int | readInt(ByteBuffer buf, int length) read Int if ((buf.position() + length) <= buf.limit() && length <= 4) { int r = 0; for (int i = 0; i < length; i++) { r |= ((buf.get() & 0xff) << (i << 3)); return r; return 0; ... |
int | readInt(ByteBuffer buf, int pos) Reads a specific integer byte value (4 bytes) from the input byte buffer at the given offset. return (((buf.get(pos) & 0xff) << 24) | ((buf.get(pos + 1) & 0xff) << 16) | ((buf.get(pos + 2) & 0xff) << 8)
| (buf.get(pos + 3) & 0xff));
|
int | readInt(ByteBuffer buffer) read Int buffer.order(ByteOrder.LITTLE_ENDIAN); int value = buffer.getInt(); buffer.order(ByteOrder.BIG_ENDIAN); return value; |
int | readInt(ByteBuffer buffer) read Int int i = buffer.get() & 0xff; i |= (buffer.get() & 0xff) << 8; i |= (buffer.get() & 0xff) << 16; i |= (buffer.get() & 0xff) << 24; return i; |
Integer | readInt(ReadableByteChannel channel, ByteBuffer buffer) read Int return readAndFlip(channel, buffer, 4) ? buffer.getInt() : null;
|
int | readInt16(ByteBuffer bb) read Int return bb.getShort();
|
int | readInt32(ByteBuffer bb) Read an 32-bit signed integer from the byte buffer. return bb.getInt();
|