org.apache.xmlgraphics.image.codec.png
Class PNGChunk
java.lang.Object
org.apache.xmlgraphics.image.codec.png.PNGChunk
public class PNGChunk
- extends Object
Nested Class Summary |
static class |
PNGChunk.ChunkType
See 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 |
protected static org.apache.commons.logging.Log |
log
logger |
Constructor Summary |
PNGChunk(int length,
int type,
byte[] data,
int crc)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
protected static org.apache.commons.logging.Log log
- logger
PNGChunk
public PNGChunk(int length,
int type,
byte[] data,
int crc)
getLength
public int getLength()
getType
public int getType()
getTypeString
public String 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
public String getString4(int offset)
isType
public boolean isType(String typeName)
readChunk
public static PNGChunk readChunk(DataInputStream distream)
- Reads the next chunk from the input stream.
- Parameters:
distream
- the input stream
- Returns:
- the chunk
getChunkType
public static String getChunkType(DataInputStream distream)
- 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
skipChunk
public static boolean skipChunk(DataInputStream distream)
- Skips the next chunk from the input stream.
- Parameters:
distream
- the input stream
- Returns:
- true if skipping successful, false otherwise
Copyright 1999-2012 The Apache Software Foundation. All Rights Reserved.