@Override
    public int read() throws EOFException {
        return (pos < size) ? (data[pos++] & 0xff) : -1;
    }
@Test
    public void testRead() throws Exception {
        for (int i = 0; i < in.size; i++) {
            int readValidPos = in.read();
            // Compare the unsigned byte range equivalents of
            // the initial values with the values we read, as
            // the contract of the read() says that the values
            // need to be in that range.
            assertEquals(INIT_DATA[i] & 0xFF, readValidPos);

        }
        //try to read an invalid position should return -1
        assertEquals(-1, in.read());
    }