Class PNGConverter.Chunk

  • Enclosing class:
    PNGConverter

    static final class PNGConverter.Chunk
    extends java.lang.Object
    Holds the information about a chunks
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) byte[] bytes
      This field holds the whole byte array; In that it's redundant, as all chunks will have the same byte array.
      (package private) int chunkType
      The chunk type, see the CHUNK_??? constants.
      (package private) int crc
      The crc of the chunk data, as stored in the PNG stream.
      (package private) int length
      The length of the data within the byte array.
      (package private) int start
      The start index of the chunk data within bytes.
    • Constructor Summary

      Constructors 
      Constructor Description
      Chunk()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) byte[] getData()
      Get the data of this chunk as a byte array
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • bytes

        byte[] bytes
        This field holds the whole byte array; In that it's redundant, as all chunks will have the same byte array. But have this byte array per chunk makes it easier to validate and pass around. And we won't have that many chunks, so those 8 bytes for the pointer (on 64-bit systems) don't matter.
      • chunkType

        int chunkType
        The chunk type, see the CHUNK_??? constants.
      • crc

        int crc
        The crc of the chunk data, as stored in the PNG stream.
      • start

        int start
        The start index of the chunk data within bytes.
      • length

        int length
        The length of the data within the byte array.
    • Constructor Detail

      • Chunk

        Chunk()
    • Method Detail

      • getData

        byte[] getData()
        Get the data of this chunk as a byte array
        Returns:
        a byte-array with only the data of the chunk