@Test
    public void testSkipReadEnd() throws IOException {
        final int count = 128;
        TailStream stream = new TailStream(generateStream(0, count), 2 * count);
        readStream(stream);
        assertEquals(-1, stream.skip(1), "Wrong result");
    }
Tests skip() if read reaches the end of the stream and returns -1.
tika-core/src/test/java/org/apache/tika/io/TailStreamTest.java