Class PngChunk

    • 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
    • Constructor Detail

      • PngChunk

        public PngChunk​(int length,
                        int chunkType,
                        int crc,
                        byte[] bytes)
        Constructor.
        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
    • 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 a ByteArrayInputStream for the chunk bytes.

        The caller is responsible for closing the resource.

        Returns:
        a ByteArrayInputStream for the chunk bytes