public static class ImageType.Util extends Object
ImageType
to determine the ImageType.type.| Constructor and Description |
|---|
ImageType.Util() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getFileSuffix(byte[] b)
Determines the file suffix (i.e the image format) of the given bytes from the header
of a file.
|
static String |
getFileSuffix(InputStream stream)
Determines the file suffix (i.e the image format) of the given InputStream.
|
static String |
getFileSuffix(InputStream stream,
byte[] b)
Determines the file suffix (i.e the image format) of the given InputStream.
|
public static String getFileSuffix(InputStream stream) throws IOException
ImageType.MAGIC_MAX_SIZE bytes
of read-ahead.stream - stream to parse, InputStream.available() must be ≥ ImageType.MAGIC_MAX_SIZEnullIOException - if an I/O exception occurredpublic static String getFileSuffix(InputStream stream, byte[] b) throws IOException
ImageType.MAGIC_MAX_SIZE bytes
of read-ahead.stream - stream to parse, InputStream.available() must be ≥ ImageType.MAGIC_MAX_SIZEb - byte array sink, size must be ≥ ImageType.MAGIC_MAX_SIZEnullIOException - if an I/O exception occurredpublic static String getFileSuffix(byte[] b)
b - byte array to parse, size must be ≥ ImageType.MAGIC_MAX_SIZEnullIOException - if an I/O exception occurredCopyright 2010 JogAmp Community.