Class PngChunk

    • Field Detail

      • length

        private final int length
      • chunkType

        private final int chunkType
      • crc

        private final int crc
      • bytes

        private final byte[] bytes
      • propertyBits

        private final boolean[] propertyBits
      • ancillary

        private final boolean ancillary
      • isPrivate

        private final boolean isPrivate
      • reserved

        private final boolean reserved
      • safeToCopy

        private final boolean safeToCopy
    • Constructor Detail

      • PngChunk

        public PngChunk​(int length,
                        int chunkType,
                        int crc,
                        byte[] bytes)
        Constructs 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:
        java.lang.NullPointerException - if bytes is null.
    • Method Detail

      • getBytes

        public byte[] getBytes()
        Gets a copy of the chunk bytes.
        Returns:
        the chunk bytes
      • getChunkType

        public int getChunkType()
      • getCrc

        public int getCrc()
      • getDataStream

        protected java.io.ByteArrayInputStream getDataStream()
        Gets a new ByteArrayInputStream for the chunk bytes.

        The caller is responsible for closing the resource.

        Returns:
        a ByteArrayInputStream for the chunk bytes
      • getLength

        public int getLength()
      • getPropertyBits

        public boolean[] getPropertyBits()
        Gets a copy of the chunk property bits.
        Returns:
        the chunk property bits
      • isAncillary

        public boolean isAncillary()
      • isPrivate

        public boolean isPrivate()
      • isReserved

        public boolean isReserved()
      • isSafeToCopy

        public boolean isSafeToCopy()