Closed eleduc closed 5 years ago
Sounds like a good change. Would you like to send a pull request?
Yes, I will send you a pull request before end of this week.
Pull request done. I just perform a maven package command and it is fine. Let me know if missed to perform something.
Thanks for the PR. This will be included in the next release.
Why the inputStream parameter for the static method FileTypeDetector.detectFileType should be a BufferedInputStream and not a FilterInputStream ? The mark / reset mechanism is supported by the FilterInputStream implementation and due to the use of BufferedInputStream, it is not possible to use a derived class from FilterInputStream. As a consequence, we have to wrap any FilterInputStream instance within a new BufferedInputStream instance in order to be able to use this method. Moreover, we have to mark and reset the wrapped FilterInputStream, because the mark/reset mechanism is performed on the newly created BufferedInputStream. I do the change on a local version of this library, and it works fine : no need anymore to wrap and to mark/reset the stream.
My local change is :
and I use it like this :
Without the change, I did :
Let me know if I missed something important about your implementation choice.