public class COSStream extends COSDictionary implements Closeable
items
Constructor and 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 and Description |
---|---|
Object |
accept(ICOSVisitor visitor)
visitor pattern double dispatch method.
|
void |
close() |
OutputStream |
createFilteredStream()
Deprecated.
Use
createRawOutputStream() instead. |
COSInputStream |
createInputStream()
Returns a new InputStream which reads the decoded stream data.
|
COSInputStream |
createInputStream(DecodeOptions options) |
OutputStream |
createOutputStream()
Returns a new OutputStream for writing stream data, using the current filters.
|
OutputStream |
createOutputStream(COSBase filters)
Returns a new OutputStream for writing stream data, using and the given filters.
|
InputStream |
createRawInputStream()
Returns a new InputStream which reads the encoded PDF stream data.
|
OutputStream |
createRawOutputStream()
Returns a new OutputStream for writing encoded PDF data.
|
OutputStream |
createUnfilteredStream()
Deprecated.
Use
createOutputStream() instead. |
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.
|
String |
getString()
Deprecated.
Use
toTextString() instead. |
InputStream |
getUnfilteredStream()
Deprecated.
Use
createInputStream() instead. |
void |
setFilters(COSBase filters)
Deprecated.
Use
createOutputStream(COSBase) instead. |
String |
toTextString()
Returns the contents of the stream as a PDF "text string".
|
addAll, 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, toString
getCOSObject, isDirect, setDirect
public 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 InputStream getFilteredStream() throws IOException
createRawInputStream()
instead.IOException
- when encoding causes an exceptionpublic InputStream createRawInputStream() throws IOException
IOException
- If the stream could not be read.@Deprecated public InputStream getUnfilteredStream() throws IOException
createInputStream()
instead.IOException
- when decoding causes an exceptionpublic COSInputStream createInputStream() throws IOException
IOException
- If the stream could not be read.public COSInputStream createInputStream(DecodeOptions options) throws IOException
IOException
@Deprecated public OutputStream createUnfilteredStream() throws IOException
createOutputStream()
instead.IOException
- If there is an error creating the stream.public OutputStream createOutputStream() throws IOException
IOException
- If the output stream could not be created.public OutputStream createOutputStream(COSBase filters) throws IOException
filters
- COSArray or COSName of filters to be used.IOException
- If the output stream could not be created.@Deprecated public OutputStream createFilteredStream() throws IOException
createRawOutputStream()
instead.IOException
- If there is an error creating the stream.public OutputStream createRawOutputStream() throws IOException
IOException
- If the output stream could not be created.public long getLength()
public COSBase getFilters()
@Deprecated public void setFilters(COSBase filters) throws IOException
createOutputStream(COSBase)
instead.filters
- The filters to set on this stream.IOException
- If there is an error clearing the old filters.@Deprecated public String getString()
toTextString()
instead.public String toTextString()
public Object accept(ICOSVisitor visitor) throws IOException
COSDictionary
accept
in class COSDictionary
visitor
- The object to notify when visiting this object.IOException
- If there is an error visiting this object.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2002–2018 The Apache Software Foundation. All rights reserved.