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.
|
COSStream(ScratchFile scratchFile,
RandomAccessReadView randomAccessReadView)
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() |
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.
|
RandomAccessRead |
createView()
Returns a new RandomAccessRead which reads the decoded stream data.
|
COSBase |
getFilters()
This will return the filters to apply to the byte stream.
|
long |
getLength()
Returns the length of the encoded stream.
|
boolean |
hasData()
Indicates whether the stream contains any data or not.
|
String |
toTextString()
Returns the contents of the stream as a PDF "text string".
|
addAll, asUnmodifiableDictionary, clear, containsKey, containsKey, containsValue, entrySet, forEach, getBoolean, getBoolean, getBoolean, getCOSArray, getCOSDictionary, getCOSDictionary, getCOSName, getCOSName, getCOSObject, getCOSStream, getDate, getDate, getDate, getDate, getDictionaryObject, getDictionaryObject, getDictionaryObject, getEmbeddedDate, getEmbeddedDate, getEmbeddedInt, getEmbeddedInt, getEmbeddedString, getEmbeddedString, getFlag, getFloat, getFloat, getFloat, getFloat, getInt, getInt, getInt, getInt, getInt, getInt, getItem, getItem, getItem, getKeyForValue, getLong, getLong, getLong, getLong, getNameAsString, getNameAsString, getNameAsString, getNameAsString, getObjectFromPath, getString, getString, getString, getString, getValues, isNeedToBeUpdated, keySet, removeItem, setBoolean, setBoolean, setDate, setDate, setEmbeddedDate, setEmbeddedInt, 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.public COSStream(ScratchFile scratchFile, RandomAccessReadView randomAccessReadView) throws IOException
scratchFile - Scratch file for writing stream data.IOException - if the length of the random access view isn't availablepublic InputStream createRawInputStream() throws IOException
IOException - If the stream could not be read.public COSInputStream createInputStream() throws IOException
IOException - If the stream could not be read.public COSInputStream createInputStream(DecodeOptions options) throws IOException
IOExceptionpublic RandomAccessRead createView() throws IOException
IOException - If the stream could not be read.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.public OutputStream createRawOutputStream() throws IOException
IOException - If the output stream could not be created.public long getLength()
public COSBase getFilters()
public String toTextString()
public Object accept(ICOSVisitor visitor) throws IOException
COSDictionaryaccept in class COSDictionaryvisitor - 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 Closeableclose in interface AutoCloseableIOExceptionpublic boolean hasData()
Copyright © 2002–2021 The Apache Software Foundation. All rights reserved.