Class LZWDecoder

java.lang.Object
icyllis.arc3d.core.image.LZWDecoder

public final class LZWDecoder extends Object
The GIF format uses LSB first. The initial code size can vary between 2 and 8 bits, inclusive.
  • Constructor Details

    • LZWDecoder

      public LZWDecoder()
  • Method Details

    • getInstance

      public static LZWDecoder getInstance()
      Returns thread local instance.
    • setData

      public byte[] setData(ByteBuffer data, int initCodeSize)
      Reset the decoder with the given input data buffer.
      Parameters:
      data - the compressed data
      Returns:
      the string table
    • readString

      public int readString()
      Decode next string of data, which can be accessed by setData(ByteBuffer, int) method.
      Returns:
      the length of string, or -1 on EOF