java.lang.Object | |
↳ | com.facebook.imageformat.ImageFormatChecker |
Detects the format of an encoded image.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ImageFormat | determineImageFormat(InputStream is) | ||||||||||
static ImageFormat |
getImageFormat(InputStream is)
Tries to read up to MAX_HEADER_LENGTH bytes from InputStream is and use read bytes to determine
type of the image contained in is.
| ||||||||||
static ImageFormat |
getImageFormat(String filename)
Reads image header from a file indicated by provided filename and determines its format.
| ||||||||||
static ImageFormat | getImageFormat_WrapIOException(InputStream is) | ||||||||||
synchronized static ImageFormatChecker |
getInstance()
Get the currently used instance of the image format checker
| ||||||||||
void | setCustomImageFormatCheckers(List<ImageFormat.FormatChecker> customImageFormatCheckers) |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Tries to read up to MAX_HEADER_LENGTH bytes from InputStream is and use read bytes to determine type of the image contained in is. If provided input stream does not support mark, then this method consumes data from is and it is not safe to read further bytes from is after this method returns. Otherwise, if mark is supported, it will be used to preserve original content of is.
IOException | if exception happens during read |
---|
Reads image header from a file indicated by provided filename and determines its format. This
method does not throw IOException if one occurs. In this case, UNKNOWN
will
be returned.
Get the currently used instance of the image format checker