Class PngChunk
- java.lang.Object
-
- org.apache.commons.imaging.common.BinaryFileParser
-
- org.apache.commons.imaging.formats.png.chunks.PngChunk
-
- Direct Known Subclasses:
PngChunkGama,PngChunkIccp,PngChunkIdat,PngChunkIhdr,PngChunkPhys,PngChunkPlte,PngChunkScal,PngTextChunk
public class PngChunk extends BinaryFileParser
A PNG image is composed of several chunks. This is the base class for the chunks, used by the parser.
-
-
Field Summary
Fields Modifier and Type Field Description booleanancillaryprivate byte[]bytesintchunkTypeintcrcbooleanisPrivateintlengthprivate boolean[]propertyBitsbooleanreservedbooleansafeToCopy
-
Constructor Summary
Constructors Constructor Description PngChunk(int length, int chunkType, int crc, byte[] bytes)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getBytes()Return a copy of the chunk bytes.protected java.io.ByteArrayInputStreamgetDataStream()Create and return aByteArrayInputStreamfor the chunk bytes.boolean[]getPropertyBits()Return a copy of the chunk property bits.-
Methods inherited from class org.apache.commons.imaging.common.BinaryFileParser
debugNumber, debugNumber, getByteOrder, setByteOrder
-
-
-
-
Field Detail
-
length
public final int length
-
chunkType
public final int chunkType
-
crc
public final int crc
-
bytes
private final byte[] bytes
-
propertyBits
private final boolean[] propertyBits
-
ancillary
public final boolean ancillary
-
isPrivate
public final boolean isPrivate
-
reserved
public final boolean reserved
-
safeToCopy
public final boolean safeToCopy
-
-
Method Detail
-
getBytes
public byte[] getBytes()
Return a copy of the chunk bytes.- Returns:
- the chunk bytes
-
getPropertyBits
public boolean[] getPropertyBits()
Return a copy of the chunk property bits.- Returns:
- the chunk property bits
-
getDataStream
protected java.io.ByteArrayInputStream getDataStream()
Create and return aByteArrayInputStreamfor the chunk bytes.The caller is responsible for closing the resource.
- Returns:
- a ByteArrayInputStream for the chunk bytes
-
-