Package icyllis.arc3d.core.image

# 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 Summary

  Constructors
  Constructor
  Description
  `LZWDecoder()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static LZWDecoder`
  `getInstance()`
  Returns thread local instance.
  `int`
  `readString()`
  Decode next string of data, which can be accessed by `setData(ByteBuffer, int)` method.
  `byte[]`
  `setData(ByteBuffer data, int initCodeSize)`
  Reset the decoder with the given input data buffer.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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