Class LZWCompressor

java.lang.Object
com.itextpdf.io.codec.LZWCompressor

public class LZWCompressor extends Object
Modified from original LZWCompressor to change interface to passing a buffer of data to be compressed.
  • Constructor Details

    • LZWCompressor

      public LZWCompressor (OutputStream outputStream, int codeSize, boolean TIFF) throws IOException
      Parameters:
      outputStream - destination for compressed data
      codeSize - the initial code size for the LZW compressor
      TIFF - flag indicating that TIFF lzw fudge needs to be applied
      Throws:
      IOException - if underlying output stream error
  • Method Details

    • compress

      public void compress (byte[] buf, int offset, int length) throws IOException
      Parameters:
      buf - The data to be compressed to output stream
      offset - The offset at which the data starts
      length - The length of the data being compressed
      Throws:
      IOException - if underlying output stream error
    • flush

      public void flush() throws IOException
      Indicate to compressor that no more data to go so write out any remaining buffered data.
      Throws:
      IOException - if underlying output stream error