java.io.Closeable, java.lang.AutoCloseable, COSUpdateInfo, COSObjectablepublic class COSStream extends COSDictionary implements java.io.Closeable
items| Constructor | Description |
|---|---|
COSStream() |
Creates a new stream with an empty dictionary.
|
COSStream(ScratchFile scratchFile) |
Creates a new stream with an empty dictionary.
|
| Modifier and Type | Method | Description |
|---|---|---|
java.lang.Object |
accept(ICOSVisitor visitor) |
visitor pattern double dispatch method.
|
void |
close() |
|
java.io.OutputStream |
createFilteredStream() |
Deprecated.
Use
createRawOutputStream() instead. |
COSInputStream |
createInputStream() |
Returns a new InputStream which reads the decoded stream data.
|
COSInputStream |
createInputStream(DecodeOptions options) |
|
java.io.OutputStream |
createOutputStream() |
Returns a new OutputStream for writing stream data, using the current filters.
|
java.io.OutputStream |
createOutputStream(COSBase filters) |
Returns a new OutputStream for writing stream data, using and the given filters.
|
java.io.InputStream |
createRawInputStream() |
Returns a new InputStream which reads the encoded PDF stream data.
|
java.io.OutputStream |
createRawOutputStream() |
Returns a new OutputStream for writing encoded PDF data.
|
java.io.OutputStream |
createUnfilteredStream() |
Deprecated.
Use
createOutputStream() instead. |
java.io.InputStream |
getFilteredStream() |
Deprecated.
Use
createRawInputStream() instead. |
COSBase |
getFilters() |
This will return the filters to apply to the byte stream.
|
long |
getLength() |
Returns the length of the encoded stream.
|
java.lang.String |
getString() |
Deprecated.
Use
toTextString() instead. |
java.io.InputStream |
getUnfilteredStream() |
Deprecated.
Use
createInputStream() instead. |
void |
setFilters(COSBase filters) |
Deprecated.
Use
createOutputStream(COSBase) instead. |
java.lang.String |
toTextString() |
Returns the contents of the stream as a PDF "text string".
|
getCOSObject, isDirect, setDirectaddAll, asUnmodifiableDictionary, clear, containsKey, containsKey, containsValue, entrySet, getBoolean, getBoolean, getBoolean, getCOSName, getCOSName, getDate, getDate, getDate, getDate, getDictionaryObject, getDictionaryObject, getDictionaryObject, getDictionaryObject, getEmbeddedDate, getEmbeddedDate, getEmbeddedDate, getEmbeddedDate, getEmbeddedInt, getEmbeddedInt, getEmbeddedInt, getEmbeddedInt, getEmbeddedString, getEmbeddedString, getEmbeddedString, getEmbeddedString, getFlag, getFloat, getFloat, getFloat, getFloat, getInt, getInt, getInt, getInt, getInt, getInt, getInt, getItem, getItem, getItem, getKeyForValue, getLong, getLong, getLong, getLong, getLong, getNameAsString, getNameAsString, getNameAsString, getNameAsString, getObjectFromPath, getString, getString, getString, getString, getValues, isNeedToBeUpdated, keySet, mergeInto, removeItem, setBoolean, setBoolean, setDate, setDate, setEmbeddedDate, setEmbeddedDate, setEmbeddedInt, setEmbeddedInt, setEmbeddedString, setEmbeddedString, setFlag, setFloat, setFloat, setInt, setInt, setItem, setItem, setItem, setItem, setLong, setLong, setName, setName, setNeedToBeUpdated, setString, setString, size, toStringpublic COSStream()
Try to avoid using this constructor because it creates a new scratch file in memory. Instead,
use document.getDocument().createCOSStream() which will
use the existing scratch file (in memory or in temp file) of the document.
public COSStream(ScratchFile scratchFile)
scratchFile - Scratch file for writing stream data.@Deprecated
public java.io.InputStream getFilteredStream()
throws java.io.IOException
createRawInputStream() instead.java.io.IOException - when encoding causes an exceptionpublic java.io.InputStream createRawInputStream()
throws java.io.IOException
java.io.IOException - If the stream could not be read.@Deprecated
public java.io.InputStream getUnfilteredStream()
throws java.io.IOException
createInputStream() instead.java.io.IOException - when decoding causes an exceptionpublic COSInputStream createInputStream() throws java.io.IOException
java.io.IOException - If the stream could not be read.public COSInputStream createInputStream(DecodeOptions options) throws java.io.IOException
java.io.IOException@Deprecated
public java.io.OutputStream createUnfilteredStream()
throws java.io.IOException
createOutputStream() instead.java.io.IOException - If there is an error creating the stream.public java.io.OutputStream createOutputStream()
throws java.io.IOException
java.io.IOException - If the output stream could not be created.public java.io.OutputStream createOutputStream(COSBase filters) throws java.io.IOException
filters - COSArray or COSName of filters to be used.java.io.IOException - If the output stream could not be created.@Deprecated
public java.io.OutputStream createFilteredStream()
throws java.io.IOException
createRawOutputStream() instead.java.io.IOException - If there is an error creating the stream.public java.io.OutputStream createRawOutputStream()
throws java.io.IOException
java.io.IOException - If the output stream could not be created.public long getLength()
public COSBase getFilters()
@Deprecated public void setFilters(COSBase filters) throws java.io.IOException
createOutputStream(COSBase) instead.filters - The filters to set on this stream.java.io.IOException - If there is an error clearing the old filters.@Deprecated public java.lang.String getString()
toTextString() instead.public java.lang.String toTextString()
public java.lang.Object accept(ICOSVisitor visitor) throws java.io.IOException
COSDictionaryaccept in class COSDictionaryvisitor - The object to notify when visiting this object.java.io.IOException - If there is an error visiting this object.public void close()
throws java.io.IOException
close in interface java.lang.AutoCloseableclose in interface java.io.Closeablejava.io.IOExceptionCopyright © 2002–2018. All rights reserved.