Class LZWOutputStream

java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
com.adobe.internal.pdftoolkit.core.filter.LZWOutputStream
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable

public class LZWOutputStream extends FilterOutputStream
LZWOutputStream
  • Constructor Details

    • LZWOutputStream

      public LZWOutputStream(OutputStream out, FilterParams p)
      Creates an output stream filter.
      Parameters:
      out - the output stream
    • LZWOutputStream

      public LZWOutputStream(OutputStream out)
  • Method Details

    • write

      public void write(int b) throws IOException
      Writes a byte. Will block until the byte is actually written.
      Overrides:
      write in class FilterOutputStream
      Parameters:
      b - the byte
      Throws:
      IOException - If an I/O error has occurred.
    • write

      public void write(byte[] b, int off, int len) throws IOException
      Writes a subarray of bytes.
      Overrides:
      write in class FilterOutputStream
      Parameters:
      b - the data to be written
      off - the start offset in the data
      len - the number of bytes that are written
      Throws:
      IOException - If an I/O error has occurred.
    • write

      public void write(byte[] b) throws IOException
      Writes an array of bytes. Will block until the bytes are actually written.
      Overrides:
      write in class FilterOutputStream
      Parameters:
      b - the data to be written
      Throws:
      IOException - If an I/O error has occurred.
    • close

      public void close() throws IOException
      Closes the stream and writes the stream trailer. This method must be called to release any resources associated with the stream.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class FilterOutputStream
      Throws:
      IOException - If an I/O error has occurred.
    • getTotalOut

      public long getTotalOut()
      Counts the number of bytes written by this filter.
      Returns:
      actual number of bytes written