public final class JRTypeSniffer
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getImageMimeType(byte imageType)
Deprecated.
Replaced by
ImageTypeEnum . |
static byte |
getImageType(byte[] data)
Deprecated.
Replaced by
getImageTypeValue(byte[]) . |
static ImageTypeEnum |
getImageTypeValue(byte[] data) |
static boolean |
isGIF(byte[] data)
Sniffs an incoming byte array to see if the first 3 characters
are GIF.
|
static boolean |
isJPEG(byte[] data)
Sniffs an incoming byte array to see if the starting value is 0xffd8
which is the "header" for JPEG data
Note: This method only really needs the first 2 bytes.
|
static boolean |
isPNG(byte[] data)
Sniffs an incoming byte array to see if the first eight
bytes are the following (decimal) values:
137 80 78 71 13 10 26 10
which is the "signature" for PNG data
See http://www.w3.org/TR/PNG/#5PNG-file-signature
for more details.
|
static boolean |
isTIFF(byte[] data)
Sniffs an incoming byte array to see if the starting value is 0x4949
(little endian) or 0x4D4D (big endian) which is the "header" for TIFF data
The TIFF standards supports both endians.
|
public static boolean isGIF(byte[] data)
public static boolean isJPEG(byte[] data)
public static boolean isPNG(byte[] data)
public static boolean isTIFF(byte[] data)
public static byte getImageType(byte[] data)
getImageTypeValue(byte[])
.public static ImageTypeEnum getImageTypeValue(byte[] data)
public static java.lang.String getImageMimeType(byte imageType)
ImageTypeEnum
.© 2001-2014 TIBCO Software Inc. www.jaspersoft.com