Here you can find the source of readUnsignedInt(ByteBuffer buffer)
Parameter | Description |
---|---|
buffer | The buffer to read from |
public static long readUnsignedInt(ByteBuffer buffer)
//package com.java2s; //License from project: Apache License import java.nio.ByteBuffer; public class Main { /**/*from w ww . j a v a 2 s .c om*/ * Read an unsigned integer from the current position in the buffer, * incrementing the position by 4 bytes * * @param buffer The buffer to read from * @return The integer read, as a long to avoid signedness */ public static long readUnsignedInt(ByteBuffer buffer) { return buffer.getInt() & 0xffffffffL; } /** * Read an unsigned integer from the given position without modifying the buffers * position * * @param buffer the buffer to read from * @param index the index from which to read the integer * @return The integer read, as a long to avoid signedness */ public static long readUnsignedInt(ByteBuffer buffer, int index) { return buffer.getInt(index) & 0xffffffffL; } }