Class PNGChunk
java.lang.Object
org.apache.xmlgraphics.image.codec.png.PNGChunk
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSee http://en.wikipedia.org/wiki/Portable_Network_Graphics for a light explanation; See http://www.libpng.org/pub/png/spec/1.2/PNG-Chunks.html for the spec. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbytegetByte(int offset) static StringgetChunkType(DataInputStream distream) Returns the PNG chunk type, a four letter case sensitive ASCII type/name.byte[]getData()intgetInt1(int offset) intgetInt2(int offset) intgetInt4(int offset) intgetString4(int offset) intgetType()booleanstatic PNGChunkreadChunk(DataInputStream distream) Reads the next chunk from the input stream.static booleanskipChunk(DataInputStream distream) Skips the next chunk from the input stream.private static StringtypeIntToString(int type)
-
Field Details
-
length
int length -
type
int type -
data
byte[] data -
crc
int crc -
typeString
String typeString -
log
protected static final org.apache.commons.logging.Log loglogger
-
-
Constructor Details
-
PNGChunk
public PNGChunk(int length, int type, byte[] data, int crc)
-
-
Method Details
-
getLength
public int getLength() -
getType
public int getType() -
getTypeString
-
getData
public byte[] getData() -
getByte
public byte getByte(int offset) -
getInt1
public int getInt1(int offset) -
getInt2
public int getInt2(int offset) -
getInt4
public int getInt4(int offset) -
getString4
-
isType
-
readChunk
Reads the next chunk from the input stream.- Parameters:
distream- the input stream- Returns:
- the chunk
-
getChunkType
Returns the PNG chunk type, a four letter case sensitive ASCII type/name.- Parameters:
distream- the input stream- Returns:
- a four letter case sensitive ASCII type/name
-
typeIntToString
-
skipChunk
Skips the next chunk from the input stream.- Parameters:
distream- the input stream- Returns:
- true if skipping successful, false otherwise
-