public static long readUint32(ByteBuffer buf) throws BufferUnderflowException {
        return Integer.toUnsignedLong(buf.order(ByteOrder.LITTLE_ENDIAN).getInt());
    }
@Test
    public void testReadUint32() {
        assertEquals(258L, ByteUtils.readUint32(new byte[]{2, 1, 0, 0}, 0));
        assertEquals(258L, ByteUtils.readUint32(new byte[]{2, 1, 0, 0, 3, 4}, 0));
        assertEquals(772L, ByteUtils.readUint32(new byte[]{1, 2, 4, 3, 0, 0}, 2));
    }