Hi,

related to my JIRA Task (https://issues.apache.org/jira/browse/TIKA-653). I
have a problem with detecting a MimeType from a FileInputStream.

Here are an extraction of my code to understand what i'm try to do:

InputStream is = new FileInputStream(file);

Tika tika = new Tika();
tika.detect(is);

It alwas throws an java.io.IOException: Read error

I also tried to wrap the FileInputStream in a BufferedInputStream and use
the TikaInputStream. None of the options worked, i got every time the
IOException.

The funny thing is, when i create a ByteArrayInputStream from the same file
everything work as expected. The file i want to check is an .xml file but i
also tried different file types (jpg, doc..).

Any idea what's going wrong here?

Have a good day
Sascha

Reply via email to