Class Stream

    • Field Detail

      • filters

        private final java.util.List<Filter> filters
        Filters (if any) to apply to the stream data.
    • Constructor Detail

      • Stream

        Stream​(int number)
        Creates a new stream.
        Parameters:
        number - the PDF object number.
    • Method Detail

      • addFilter

        public void addFilter​(Filter f)
        Adds a filter to the stream.
        Parameters:
        f - the filter (null not permitted).
        See Also:
        removeFilters()
      • getObjectBytes

        public byte[] getObjectBytes()
                              throws java.io.IOException
        Returns the PDF bytes for this stream object, with all current filters applied.
        Specified by:
        getObjectBytes in class PDFObject
        Returns:
        The PDF bytes for this stream object.
        Throws:
        java.io.IOException - if there is a problem writing to the byte array.
      • createDictionary

        protected Dictionary createDictionary​(int streamLength)
        Creates the dictionary for this stream object. The dictionary will be populated with the stream length and the decode values for any filters that are currently applied.
        Parameters:
        streamLength - the stream length.
        Returns:
        The dictionary.
      • getRawStreamData

        public abstract byte[] getRawStreamData()
        Returns the raw data for the stream.
        Returns:
        The raw data for the stream.