Class PngChunk
java.lang.Object
org.apache.commons.imaging.common.BinaryFileParser
org.apache.commons.imaging.formats.png.chunks.PngChunk
- Direct Known Subclasses:
- AbstractPngTextChunk,- PngChunkGama,- PngChunkIccp,- PngChunkIdat,- PngChunkIhdr,- PngChunkPhys,- PngChunkPlte,- PngChunkScal
A PNG image is composed of several chunks. This is the base class for the chunks, used by the parser.
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionPngChunk(int length, int chunkType, int crc, byte[] bytes) Constructs a new instance.
- 
Method SummaryModifier and TypeMethodDescriptionbyte[]getBytes()Gets a copy of the chunk bytes.intintgetCrc()protected ByteArrayInputStreamGets a newByteArrayInputStreamfor the chunk bytes.intboolean[]Gets a copy of the chunk property bits.booleanbooleanbooleanbooleanMethods inherited from class org.apache.commons.imaging.common.BinaryFileParserdebugNumber, debugNumber, getByteOrder, setByteOrder
- 
Constructor Details- 
PngChunkConstructs a new instance.- Parameters:
- length- chunk length.
- chunkType- chunk type.
- crc- CRC computed over the chunk type and chunk data (but not the length).
- bytes- chunk data bytes.
- Throws:
- NullPointerException- if- bytesis null.
 
 
- 
- 
Method Details- 
getBytesGets a copy of the chunk bytes.- Returns:
- the chunk bytes
 
- 
getChunkType
- 
getCrc
- 
getDataStreamGets a newByteArrayInputStreamfor the chunk bytes.The caller is responsible for closing the resource. - Returns:
- a ByteArrayInputStream for the chunk bytes
 
- 
getLength
- 
getPropertyBitsGets a copy of the chunk property bits.- Returns:
- the chunk property bits
 
- 
isAncillary
- 
isPrivate
- 
isReserved
- 
isSafeToCopy
 
-