public int read()
    {
        int b = -1;
        if (position < length)
        {
            b = buffer.getByte(offset + position) & 0xFF;
            ++position;
        }

        return b;
    }
@Test
    void shouldReturnMinusOneOnEndOfStream()
    {
        final byte[] data = { 1, 2 };

        final DirectBuffer buffer = new UnsafeBuffer(data);
        final DirectBufferInputStream inputStream = new DirectBufferInputStream(buffer);

        assertEquals(inputStream.read(), 1);
        assertEquals(inputStream.read(), 2);
        assertEquals(inputStream.read(), END_OF_STREAM_MARKER);
    }