Class Filter

  • Direct Known Subclasses:
    LZWFilter

    public abstract class Filter
    extends Object
    A filter for stream data.
    • Constructor Detail

      • Filter

        protected Filter()
        Constructor.
    • Method Detail

      • decode

        public abstract DecodeResult decode​(InputStream encoded,
                                            OutputStream decoded,
                                            COSDictionary parameters,
                                            int index)
                                     throws IOException
        Decodes data, producing the original non-encoded data.
        Parameters:
        encoded - the encoded byte stream
        decoded - the stream where decoded data will be written
        parameters - the parameters used for decoding
        index - the index to the filter being decoded
        Returns:
        repaired parameters dictionary, or the original parameters dictionary
        Throws:
        IOException - if the stream cannot be decoded
      • encode

        public final void encode​(InputStream input,
                                 OutputStream encoded,
                                 COSDictionary parameters,
                                 int index)
                          throws IOException
        Encodes data.
        Parameters:
        input - the byte stream to encode
        encoded - the stream where encoded data will be written
        parameters - the parameters used for encoding
        index - the index to the filter being encoded
        Throws:
        IOException - if the stream cannot be encoded