java.lang.Object
org.apache.pdfbox.debugger.streampane.Stream

public class Stream extends Object
  • Field Details

    • LOG

      private static final org.apache.commons.logging.Log LOG
    • UNFILTERED

      public static final String UNFILTERED
      See Also:
    • IMAGE

      public static final String IMAGE
      See Also:
    • strm

      private final COSStream strm
    • isThumb

      private final boolean isThumb
    • isImage

      private final boolean isImage
    • isXmlMetadata

      private final boolean isXmlMetadata
    • filters

      private final Map<String,List<String>> filters
  • Constructor Details

    • Stream

      Stream(COSStream cosStream, boolean isThumb)
      Constructor.
      Parameters:
      cosStream - COSStream instance.
      isThumb - boolean instance says if the stream is thumbnail image.
  • Method Details

    • 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 List<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.
    • getFilteredLabel

      private String getFilteredLabel()
      Returns the label for the "Unfiltered" menu item.
    • getStream

      public InputStream getStream(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 BufferedImage getImage(PDResources resources)
      Provide the image for stream. The stream must be image XObject.
      Parameters:
      resources - PDResources for the XObject.
      Returns:
      A BufferedImage.
    • createFilterList

      private Map<String,List<String>> createFilterList(COSStream stream)
    • getPartialStreamCommand

      private String getPartialStreamCommand(int indexOfStopFilter)
    • getStopFilterList

      private List<String> getStopFilterList(int stopFilterIndex)
    • isImageStream

      private boolean isImageStream(COSDictionary dic, boolean isThumb)
    • isXmlMetadataStream

      private boolean isXmlMetadataStream(COSDictionary dic)