Please see [1] which comes into play when detecting the mime-type from content. I think there is an assumption in Tika's MagicDetector that the stream would always support mark/reset. Probably it should check it explicitly and not proceed if that's not the case.
As per the current handling, if an inputstream without mark/reset support is passed to it, some content is read off this stream but its not reset. This can potentially cause problems elsewhere where this inputstream is used. [1] - https://github.com/apache/tika/blob/trunk/tika-core/src/main/java/org/apache/tika/detect/MagicDetector.java#L352 Regards Satya Deep
