org.pdfbox.pdmodel.common
Class COSStreamArray
- COSObjectable
public class COSStreamArray
This will take an array of streams and sequence them together.
accept , createFilteredStream , createFilteredStream , createUnfilteredStream , getFilteredStream , getFilters , getScratchFile , getStreamTokens , getUnfilteredStream , replaceWithStream , setFilters |
accept , addAll , clear , containsValue , getBoolean , getBoolean , getDate , getDate , getDate , getDate , getDictionaryObject , getDictionaryObject , getDictionaryObject , getDictionaryObject , getEmbeddedDate , getEmbeddedDate , getEmbeddedDate , getEmbeddedDate , getEmbeddedInt , getEmbeddedInt , getEmbeddedInt , getEmbeddedInt , getEmbeddedString , getEmbeddedString , getEmbeddedString , getEmbeddedString , getFloat , getFloat , getFloat , getFloat , getInt , getInt , getInt , getInt , getInt , getItem , getKeyForValue , getLong , getLong , getLong , getLong , getLong , getNameAsString , getNameAsString , getNameAsString , getNameAsString , getObjectFromPath , getString , getString , getString , getString , getValues , keyList , mergeInto , removeItem , setBoolean , setBoolean , setDate , setDate , setEmbeddedDate , setEmbeddedDate , setEmbeddedInt , setEmbeddedInt , setEmbeddedString , setEmbeddedString , setFloat , setFloat , setInt , setInt , setItem , setItem , setItem , setItem , setLong , setLong , setName , setName , setString , setString , size |
COSStreamArray
public COSStreamArray(COSArray array)
Constructor.
array
- The array of COSStreams to concatenate together.
accept
public Object accept(ICOSVisitor visitor)
throws COSVisitorException
visitor pattern double dispatch method.
- accept in interface COSStream
visitor
- The object to notify when visiting this object.
- any object, depending on the visitor implementation, or null
appendStream
public void appendStream(COSStream streamToAppend)
Appends a new stream to the array that represents this object's stream.
streamToAppend
- The stream to append.
createFilteredStream
public OutputStream createFilteredStream()
throws IOException
This will create a new stream for which filtered byte should be
written to. You probably don't want this but want to use the
createUnfilteredStream, which is used to write raw bytes to.
- createFilteredStream in interface COSStream
- A stream that can be written to.
createFilteredStream
public OutputStream createFilteredStream(COSBase expectedLength)
throws IOException
This will create a new stream for which filtered byte should be
written to. You probably don't want this but want to use the
createUnfilteredStream, which is used to write raw bytes to.
- createFilteredStream in interface COSStream
expectedLength
- An entry where a length is expected.
- A stream that can be written to.
createUnfilteredStream
public OutputStream createUnfilteredStream()
throws IOException
This will create an output stream that can be written to.
- createUnfilteredStream in interface COSStream
- An output stream which raw data bytes should be written to.
getDictionary
public COSDictionary getDictionary()
This will get the dictionary that is associated with this stream.
- the object that is associated with this stream.
getDictionaryObject
public COSBase getDictionaryObject(COSName key)
This will get an object from this streams dictionary and dereference it
if necessary.
- getDictionaryObject in interface COSDictionary
key
- The key to the object.
- The dictionary object with the key or null if one does not exist.
getFilteredStream
public InputStream getFilteredStream()
throws IOException
This will get the stream with all of the filters applied.
- getFilteredStream in interface COSStream
- the bytes of the physical (endoced) stream
getFilters
public COSBase getFilters()
This will return the filters to apply to the byte stream
the method will return.
- null if no filters are to be applied
- a COSName if one filter is to be applied
- a COSArray containing COSNames if multiple filters are to be applied
- getFilters in interface COSStream
- the COSBase object representing the filters
getItem
public COSBase getItem(COSName key)
This will get an object from this streams dictionary.
- getItem in interface COSDictionary
key
- The key to the object.
- The dictionary object with the key or null if one does not exist.
getScratchFile
public RandomAccess getScratchFile()
This will get the scratch file associated with this stream.
- getScratchFile in interface COSStream
- The scratch file where this stream is being stored.
getStreamTokens
public List getStreamTokens()
throws IOException
This will get all the tokens in the stream.
- getStreamTokens in interface COSStream
- All of the tokens in the stream.
getUnfilteredStream
public InputStream getUnfilteredStream()
throws IOException
This will get the logical content stream with none of the filters.
- getUnfilteredStream in interface COSStream
- the bytes of the logical (decoded) stream
setFilters
public void setFilters(COSBase filters)
throws IOException
set the filters to be applied to the stream.
- setFilters in interface COSStream
filters
- The filters to set on this stream.
toString
public String toString()