Class AbstractWebPChunk

    • Field Detail

      • type

        private final int type
      • size

        private final int size
      • bytes

        protected final byte[] bytes
      • chunkSize

        private final int chunkSize
    • Constructor Detail

      • AbstractWebPChunk

        public AbstractWebPChunk​(int type,
                                 int size,
                                 byte[] bytes)
                          throws ImagingException
        Create a new WebP chunk.
        Parameters:
        type - chunk type.
        size - chunk size.
        bytes - chunk data.
        Throws:
        ImagingException - if the chunk data and the size provided do not match.
      • AbstractWebPChunk

        private AbstractWebPChunk​(int type,
                                  int size,
                                  byte[] bytes,
                                  boolean ignored)
    • Method Detail

      • dump

        public void dump​(java.io.PrintWriter pw,
                         int offset)
                  throws ImagingException,
                         java.io.IOException
        Print the chunk to the given stream.
        Parameters:
        pw - a stream to write to.
        offset - chunk offset.
        Throws:
        ImagingException - if the image is invalid.
        java.io.IOException - if it fails to write to the given stream.
      • getBytes

        public byte[] getBytes()
        Returns:
        a copy of the chunk data as bytes.
      • getChunkSize

        public int getChunkSize()
        Returns:
        the chunk size.
      • getPayloadSize

        public int getPayloadSize()
        Returns:
        the payload size.
      • getType

        public int getType()
        Returns:
        the chunk type.
      • getTypeDescription

        public java.lang.String getTypeDescription()
        Returns:
        the description of the chunk type.