public class FileTypeDetector
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static ByteTrie<FileType> |
_root |
Modifier | Constructor and Description |
---|---|
private |
FileTypeDetector() |
Modifier and Type | Method and Description |
---|---|
static FileType |
detectFileType(java.io.BufferedInputStream inputStream)
Examines the a file's first bytes and estimates the file's type.
|
private FileTypeDetector() throws java.lang.Exception
java.lang.Exception
public static FileType detectFileType(java.io.BufferedInputStream inputStream) throws java.io.IOException
Requires a BufferedInputStream
in order to mark and reset the stream to the position
at which it was provided to this method once completed.
Requires the stream to contain at least eight bytes.
java.io.IOException
- if an IO error occurred or the input stream ended unexpectedly.