Class COSInputStream

java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.apache.pdfbox.cos.COSInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

public final class COSInputStream extends FilterInputStream
An InputStream which reads from an encoded COS stream.
  • Field Details

  • Constructor Details

    • COSInputStream

      private COSInputStream(InputStream input, List<DecodeResult> decodeResults)
      Constructor.
      Parameters:
      input - decoded stream
      decodeResults - results of decoding
  • Method Details

    • create

      static COSInputStream create(List<Filter> filters, COSDictionary parameters, InputStream in) throws IOException
      Creates a new COSInputStream from an encoded input stream.
      Parameters:
      filters - Filters to be applied.
      parameters - Filter parameters.
      in - Encoded input stream.
      Returns:
      Decoded stream.
      Throws:
      IOException - If the stream could not be read.
    • create

      static COSInputStream create(List<Filter> filters, COSDictionary parameters, InputStream in, DecodeOptions options) throws IOException
      Creates a new COSInputStream from an encoded input stream.
      Parameters:
      filters - Filters to be applied.
      parameters - Filter parameters.
      in - Encoded input stream.
      options - decode options for the encoded stream
      Returns:
      Decoded stream.
      Throws:
      IOException - If the stream could not be read.
    • getDecodeResult

      public DecodeResult getDecodeResult()
      Returns the result of the last filter, for use by repair mechanisms.
      Returns:
      the result of the last filter