@Override
    public long skip(long n) throws IOException {
        int bufSize = (int) Math.min(n, SKIP_SIZE);
        byte[] buf = new byte[bufSize];
        long bytesSkipped = 0;
        int bytesRead = 0;

        while (bytesSkipped < n && bytesRead != -1) {
            int len = (int) Math.min(bufSize, n - bytesSkipped);
            bytesRead = read(buf, 0, len);
            if (bytesRead != -1) {
                bytesSkipped += bytesRead;
            }
        }

        return (bytesRead < 0 && bytesSkipped == 0) ? -1 : bytesSkipped;
    }
{@inheritDoc} This implementation delegates to the {@code read()} method
to ensure that the tail buffer is also filled if data is skipped.
tika-core/src/main/java/org/apache/tika/io/TailStream.java