Package com.ribs.pdf

Class PDFStream

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class PDFStream
    extends java.lang.Object
    implements java.lang.Cloneable
    This class represents a PDF stream object.
    • Constructor Summary

      Constructors 
      Constructor Description
      PDFStream​(byte[] bytes, int offset, int len, java.util.Map aMap)
      Creates a new stream by copying the byte array and map
      PDFStream​(byte[] bytes, java.util.Map aMap)
      Creates a new stream from the byte array and map.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addFilter​(java.lang.String aName)  
      java.lang.Object clone()
      Standard clone implementation.
      byte[] decodeStream()
      Returns the result of running the data through all the filters.
      byte[] decodeStream​(int nfilters)
      Returns the result of running the data through the first n filters.
      static byte[] getBytesDecoded​(byte[] bytes, int offset, int length, java.lang.String aFilter, java.util.Map params)
      Returns the result of runnning the bytes through a particular filter (/FlateDecode, /LZW, /ASCII85Decode, etc.).
      java.util.Map getDictionary()
      Returns the stream dictionary.
      byte[] getRawData()
      Returns the stream data.
      int indexOfFilter​(java.lang.String fName)
      Returns the index of a particular filter in the filter chain, or -1 if not found.
      int numFilters()
      Returns the total number of filters with which this stream is currently encoded.
      boolean usesFilter​(java.lang.String fName)
      Tests whether a specifc filter will be needed to decode the stream.
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PDFStream

        public PDFStream​(byte[] bytes,
                         java.util.Map aMap)
        Creates a new stream from the byte array and map.
      • PDFStream

        public PDFStream​(byte[] bytes,
                         int offset,
                         int len,
                         java.util.Map aMap)
        Creates a new stream by copying the byte array and map
    • Method Detail

      • getRawData

        public byte[] getRawData()
        Returns the stream data.
      • getDictionary

        public java.util.Map getDictionary()
        Returns the stream dictionary.
      • addFilter

        public void addFilter​(java.lang.String aName)
      • usesFilter

        public boolean usesFilter​(java.lang.String fName)
        Tests whether a specifc filter will be needed to decode the stream.
      • indexOfFilter

        public int indexOfFilter​(java.lang.String fName)
        Returns the index of a particular filter in the filter chain, or -1 if not found.
      • numFilters

        public int numFilters()
        Returns the total number of filters with which this stream is currently encoded.
      • decodeStream

        public byte[] decodeStream()
        Returns the result of running the data through all the filters.
      • decodeStream

        public byte[] decodeStream​(int nfilters)
        Returns the result of running the data through the first n filters.
      • getBytesDecoded

        public static byte[] getBytesDecoded​(byte[] bytes,
                                             int offset,
                                             int length,
                                             java.lang.String aFilter,
                                             java.util.Map params)
        Returns the result of runnning the bytes through a particular filter (/FlateDecode, /LZW, /ASCII85Decode, etc.).
      • clone

        public java.lang.Object clone()
        Standard clone implementation.
        Overrides:
        clone in class java.lang.Object