private static InputStream getBuffered(InputStream stream) {
        if (stream.markSupported()) {
            return stream;
        }
        return new BufferedInputStream(stream);
    }
@param stream    stream from which to read -- make sure that it supports mark!
@param metadata
@param detector
@param handler
@throws IOException
@throws TikaException
tika-core/src/main/java/org/apache/tika/detect/AutoDetectReader.java