@Override
    public int read() throws EOFException {
        return (pos < size) ? (data[pos++] & 0xff) : -1;
    }
@Test
    public void testReadPosition() throws Exception {
        int read = in.read(1);
        int readUnsigned = in.read(INIT_DATA.length - 1);
        int readEnd = in.read(INIT_DATA.length);
        assertEquals(1, read);
        // Map the expected negative value to unsigned byte range
        assertEquals(0xFF, readUnsigned);
        assertEquals(-1, readEnd);
    }