public static long readUIntLE(InputStream stream) throws IOException, BufferUnderrunException {
        int ch1 = stream.read();
        int ch2 = stream.read();
        int ch3 = stream.read();
        int ch4 = stream.read();
        if ((ch1 | ch2 | ch3 | ch4) < 0) {
            throw new BufferUnderrunException();
        }
        return ((ch4 << 24) + (ch3 << 16) + (ch2 << 8) + (ch1)) & 0x00FFFFFFFFl;
    }
@Test
    public void testReadUIntLE() throws Exception {
        byte[] data = new byte[]{(byte) 0x08, (byte) 0x00, (byte) 0x00, (byte) 0x00};
        assertEquals(8, EndianUtils.readUIntLE(new ByteArrayInputStream(data)));

        data = new byte[]{(byte) 0xF0, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF};
        assertEquals(4294967280L, EndianUtils.readUIntLE(new ByteArrayInputStream(data)));

        data = new byte[]{(byte) 0xFF, (byte) 0xFF, (byte) 0xFF};
        try {
            EndianUtils.readUIntLE(new ByteArrayInputStream(data));
            fail("Should have thrown exception");
        } catch (EndianUtils.BufferUnderrunException e) {
            //swallow
        }
    }