org.pdfbox.cos
Class COSStream
- COSObjectable
This class represents a stream object in a PDF document.
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 |
COSStream
public COSStream(COSDictionary dictionary,
RandomAccess storage)
Constructor.
dictionary
- The dictionary that is associated with this stream.storage
- The intermediate storage for the stream.
COSStream
public COSStream(RandomAccess storage)
Constructor. Creates a new stream with an empty dictionary.
storage
- The intermediate storage for the stream.
accept
public Object accept(ICOSVisitor visitor)
throws COSVisitorException
visitor pattern double dispatch method.
- accept in interface COSDictionary
visitor
- The object to notify when visiting this object.
- any object, depending on the visitor implementation, or null
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.
- 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.
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.
- An output stream which raw data bytes should be written to.
getFilteredStream
public InputStream getFilteredStream()
throws IOException
This will get the stream with all of the filters applied.
- 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
- the COSBase object representing the filters
getScratchFile
public RandomAccess getScratchFile()
This will get the scratch file associated with this stream.
- The scratch file where this stream is being stored.
getStreamTokens
public List getStreamTokens()
throws IOException
This will get all the tokens in the stream.
- 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.
- the bytes of the logical (decoded) stream
replaceWithStream
public void replaceWithStream(COSStream stream)
This will replace this object with the data from the new object. This
is used to easily maintain referential integrity when changing references
to new objects.
stream
- The stream that have the new values in it.
setFilters
public void setFilters(COSBase filters)
throws IOException
set the filters to be applied to the stream.
filters
- The filters to set on this stream.