Class FormatDetector
java.lang.Object
is.galia.codec.FormatDetector
Tries to detect a file's format by reading its signature, a.k.a. magic
bytes, and consulting
every available
decoder
to find out whether it can infer a
format
from those bytes.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Number of bytes that are recommended to read when reading may be expensive. -
Method Summary
-
Field Details
-
RECOMMENDED_READ_LENGTH
public static final int RECOMMENDED_READ_LENGTHNumber of bytes that are recommended to read when reading may be expensive.- See Also:
-
-
Method Details
-
detect
- Parameters:
inputStream
- Stream to probe.- Returns:
- Format of the given magic bytes, if the format is supported;
otherwise
Format.UNKNOWN
. - Throws:
IOException
-
detect
- Parameters:
path
- File to probe.- Returns:
- Format of the given magic bytes, if the format is supported;
otherwise
Format.UNKNOWN
. - Throws:
IOException
-