Package com.drew.imaging
Class FileTypeDetector
java.lang.Object
com.drew.imaging.FileTypeDetector
Examines the a file's first bytes and estimates the file's type.
-
Method Summary
Modifier and TypeMethodDescriptionstatic FileTypedetectFileType(InputStream inputStream) Examines the file's bytes and estimates the file's type.
-
Method Details
-
detectFileType
Examines the file's bytes and estimates the file's type.The input stream must support mark and reset, in order to return the stream to the position at which it was provided to this method once completed.
Requires the stream to contain at least eight bytes.
- Throws:
IOException- if the stream does not support mark/reset.
-