@Override
    public void close() throws IOException {
        if (closeShieldDepth > 0) {
            return;
        }
        path = null;
        mark = -1;

        // The close method was explicitly called, so we indeed
        // are expected to close the input stream. Handle that
        // by adding that stream as a resource to be tracked before
        // closing all of them. This way also possible exceptions from
        // the close() calls get managed properly.
        tmp.addResource(in);
        tmp.close();
    }
This relies on {@link IOUtils#skip(InputStream, long, byte[])} to ensure
that the alleged bytes skipped were actually skipped.

@param ln the number of bytes to skip
@return the number of bytes skipped
@throws IOException if the number of bytes requested to be skipped does not match the
number of bytes skipped or if there's an IOException during the read.
tika-core/src/main/java/org/apache/tika/io/TikaInputStream.java