public InputSource asInputSource() {
        InputSource source = new InputSource(this);
        source.setEncoding(charset.name());
        return source;
    }
@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