Class Stream


  • public class Stream
    extends java.lang.Object
    Author:
    Khyrul Bashar A class that provides the COSStream in various views and related information.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String IMAGE  
      static java.lang.String UNFILTERED  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<java.lang.String> getFilterList()
      Return the available filter list.
      java.awt.image.BufferedImage getImage​(org.apache.pdfbox.pdmodel.PDResources resources)
      Provide the image for stream.
      java.io.InputStream getStream​(java.lang.String key)
      Returns a InputStream of a partially filtered stream.
      boolean isImage()
      Return if this is stream is an Image XObject.
      boolean isXmlMetadata()
      Return if this is stream is an Metadata stream.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • isImage

        public boolean isImage()
        Return if this is stream is an Image XObject.
        Returns:
        true if this an image and false otherwise.
      • isXmlMetadata

        public boolean isXmlMetadata()
        Return if this is stream is an Metadata stream.
        Returns:
        true if this a metadata stream and false otherwise.
      • getFilterList

        public java.util.List<java.lang.String> getFilterList()
        Return the available filter list. Only "Unfiltered" is returned if there is no filter and in case of XObject image type stream "Image" is also included in the list.
        Returns:
        An array of String.
      • getStream

        public java.io.InputStream getStream​(java.lang.String key)
        Returns a InputStream of a partially filtered stream.
        Parameters:
        key - is an instance of String which tells which version of stream should be returned.
        Returns:
        an InputStream.
      • getImage

        public java.awt.image.BufferedImage getImage​(org.apache.pdfbox.pdmodel.PDResources resources)
        Provide the image for stream. The stream must be image XObject.
        Parameters:
        resources - PDResources for the XObject.
        Returns:
        A BufferedImage.