Java Utililty Methods ByteBuffer to Int Array

List of utility methods to do ByteBuffer to Int Array

Description

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

Method

int[]deserializeIntArray(ByteBuffer buffer)
deserialize Int Array
int size = buffer.getInt();
int[] nums = new int[size];
for (int i = 0; i < size; i++) {
    nums[i] = buffer.getInt();
return nums;
int[]deserializeIntArray(ByteBuffer buffer)
deserialize Int Array
int size = buffer.getInt();
int[] nums = new int[size];
for (int i = 0; i < size; i++) {
    nums[i] = buffer.getInt();
return nums;
int[]getInt(ByteBuffer b, int n)
get Int
int i[] = new int[n];
for (int k = 0; k < i.length; k++) {
    i[k] = b.getInt();
return i;
longgetInt(ByteBuffer bb)
Get an unsigned int from the byte buffer.
return (bb.getInt() & 0xffffffffL);
intgetInt(ByteBuffer bb, int bi)
get Int
return makeInt(bb.get(bi + 3), bb.get(bi + 2), bb.get(bi + 1), bb.get(bi));
intgetInt(ByteBuffer buffer, ByteOrder order)
get Int
int offset = buffer.position();
int rtn = getInt(buffer, offset, order);
buffer.position(offset + 4);
return rtn;
longgetInt(ByteBuffer byteBuffer)
get Int
return ((long) byteBuffer.getInt() & INT_PADDING);
intgetInt(ByteBuffer intCalculator, byte[] bytes)
Calculates the corresponding integer given 4 sequential bytes.
intCalculator.clear();
intCalculator.put(bytes);
intCalculator.position(0);
return intCalculator.getInt();
intgetInt8(ByteBuffer input)
get Int
return input.get();
int[]getIntArray(ByteBuffer buffer, int size)
get Int Array
int[] result = new int[size];
for (int i = 0; i < size; i++) {
    result[i] = buffer.getInt();
return result;