public class FileTypeDetector extends Object
Modifier and Type | Method and Description |
---|---|
static FileType |
detectFileType(InputStream inputStream)
Examines the file's bytes and estimates the file's type.
|
public static FileType detectFileType(InputStream inputStream) throws IOException
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.
IOException
- if the stream does not support mark/reset.Copyright © 2002-2020 Drew Noakes. All Rights Reserved.