Class MyLzwDecompressor

java.lang.Object
org.apache.commons.imaging.common.mylzw.MyLzwDecompressor

public final class MyLzwDecompressor extends Object
  • Field Details

    • MAX_TABLE_SIZE

      private static final int MAX_TABLE_SIZE
      See Also:
    • table

      private final byte[][] table
    • codeSize

      private int codeSize
    • initialCodeSize

      private final int initialCodeSize
    • codes

      private int codes
    • byteOrder

      private final ByteOrder byteOrder
    • listener

      private final MyLzwDecompressor.Listener listener
    • clearCode

      private final int clearCode
    • eoiCode

      private final int eoiCode
    • written

      private int written
    • tiffLZWMode

      private boolean tiffLZWMode
  • Constructor Details

  • Method Details

    • initializeTable

      private void initializeTable()
    • clearTable

      private void clearTable()
    • getNextCode

      private int getNextCode(MyBitInputStream is) throws IOException
      Throws:
      IOException
    • stringFromCode

      private byte[] stringFromCode(int code) throws IOException
      Throws:
      IOException
    • isInTable

      private boolean isInTable(int code)
    • firstChar

      private byte firstChar(byte[] bytes)
    • addStringToTable

      private void addStringToTable(byte[] bytes) throws IOException
      Throws:
      IOException
    • appendBytes

      private byte[] appendBytes(byte[] bytes, byte b)
    • writeToResult

      private void writeToResult(OutputStream os, byte[] bytes) throws IOException
      Throws:
      IOException
    • setTiffLZWMode

      public void setTiffLZWMode()
    • decompress

      public byte[] decompress(InputStream is, int expectedLength) throws IOException
      Throws:
      IOException
    • checkCodeSize

      private void checkCodeSize()
    • incrementCodeSize

      private void incrementCodeSize()