tika-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jukka Zitting <jukka.zitt...@gmail.com>
Subject Re: svn commit: r995880 - /tika/trunk/tika-core/src/main/java/org/apache/tika/parser/AutoDetectParser.java
Date Fri, 10 Sep 2010 18:19:43 GMT
Hi,

On Fri, Sep 10, 2010 at 7:19 PM,  <nick@apache.org> wrote:
> -        // We need (reliable!) mark support for type detection before parsing
> -        stream = new BufferedInputStream(stream);
> +        if(stream instanceof TikaInputStream || stream instanceof BufferedInputStream)
{
> +           // Input stream can be trusted for type detection
> +        } else {
> +           // We need (reliable!) mark support for type detection before parsing
> +           stream = new BufferedInputStream(stream);
> +        }

Nice, good point! Even better, I'd simplify this to:

    // Ensure reliable mark support for type detection before parsing
    stream = TikaInputStream.get(stream);

BR,

Jukka Zitting

Mime
View raw message