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.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FileTypedetectFileType(InputStream inputStream) Examines the file's bytes and estimates the file's type.
-
Field Details
-
_root
-
_fixedCheckers
-
_bytesNeeded
private static final int _bytesNeeded
-
-
Constructor Details
-
FileTypeDetector
- Throws:
Exception
-
-
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.
-