Class Stream
- java.lang.Object
-
- org.apache.pdfbox.debugger.streampane.Stream
-
public class Stream extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,java.util.List<java.lang.String>>
filters
static java.lang.String
IMAGE
private boolean
isImage
private boolean
isThumb
private boolean
isXmlMetadata
private static org.apache.commons.logging.Log
LOG
private COSStream
strm
static java.lang.String
UNFILTERED
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.util.Map<java.lang.String,java.util.List<java.lang.String>>
createFilterList(COSStream stream)
private java.lang.String
getFilteredLabel()
Returns the label for the "Unfiltered" menu item.java.util.List<java.lang.String>
getFilterList()
Return the available filter list.java.awt.image.BufferedImage
getImage(PDResources resources)
Provide the image for stream.private java.lang.String
getPartialStreamCommand(int indexOfStopFilter)
private java.util.List<java.lang.String>
getStopFilterList(int stopFilterIndex)
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.private boolean
isImageStream(COSDictionary dic, boolean isThumb)
boolean
isXmlMetadata()
Return if this is stream is an Metadata stream.private boolean
isXmlMetadataStream(COSDictionary dic)
-
-
-
Field Detail
-
LOG
private static final org.apache.commons.logging.Log LOG
-
UNFILTERED
public static final java.lang.String UNFILTERED
- See Also:
- Constant Field Values
-
IMAGE
public static final java.lang.String IMAGE
- See Also:
- Constant Field Values
-
strm
private final COSStream strm
-
isThumb
private final boolean isThumb
-
isImage
private final boolean isImage
-
isXmlMetadata
private final boolean isXmlMetadata
-
filters
private final java.util.Map<java.lang.String,java.util.List<java.lang.String>> filters
-
-
Constructor Detail
-
Stream
Stream(COSStream cosStream, boolean isThumb)
Constructor.- Parameters:
cosStream
- COSStream instance.isThumb
- boolean instance says if the stream is thumbnail image.
-
-
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.
-
getFilteredLabel
private java.lang.String getFilteredLabel()
Returns the label for the "Unfiltered" menu item.
-
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(PDResources resources)
Provide the image for stream. The stream must be image XObject.- Parameters:
resources
- PDResources for the XObject.- Returns:
- A BufferedImage.
-
createFilterList
private java.util.Map<java.lang.String,java.util.List<java.lang.String>> createFilterList(COSStream stream)
-
getPartialStreamCommand
private java.lang.String getPartialStreamCommand(int indexOfStopFilter)
-
getStopFilterList
private java.util.List<java.lang.String> getStopFilterList(int stopFilterIndex)
-
isImageStream
private boolean isImageStream(COSDictionary dic, boolean isThumb)
-
isXmlMetadataStream
private boolean isXmlMetadataStream(COSDictionary dic)
-
-