|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jasperreports.engine.util.JRTypeSniffer
public class JRTypeSniffer
Constructor Summary | |
---|---|
JRTypeSniffer()
|
Method Summary | |
---|---|
static java.lang.String |
getImageMimeType(byte imageType)
|
static byte |
getImageType(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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JRTypeSniffer()
Method Detail |
---|
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)
public static java.lang.String getImageMimeType(byte imageType)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |