public class ReadOnlyFilteredCOSStream
extends org.sejda.sambox.cos.COSStream
COSStream whose purpose is to be read by the PDF writer during the write process. This can allow to create
streams from File input streams and predefine the expected dictionary without having to read anything into memory.| Modifier and Type | Class and Description |
|---|---|
static interface |
ReadOnlyFilteredCOSStream.InputStreamSupplier<T extends InputStream> |
| Constructor and Description |
|---|
ReadOnlyFilteredCOSStream(org.sejda.sambox.cos.COSDictionary existingDictionary,
ReadOnlyFilteredCOSStream.InputStreamSupplier<InputStream> stream,
long length) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addCompression() |
void |
close() |
OutputStream |
createFilteredStream() |
OutputStream |
createFilteredStream(org.sejda.sambox.cos.COSBase filters) |
OutputStream |
createUnfilteredStream() |
protected InputStream |
doGetFilteredStream() |
boolean |
encryptable() |
void |
encryptable(boolean encryptable) |
long |
getFilteredLength() |
long |
getUnfilteredLength() |
org.sejda.io.SeekableSource |
getUnfilteredSource() |
InputStream |
getUnfilteredStream() |
org.sejda.sambox.cos.IndirectCOSObjectIdentifier |
id() |
void |
idIfAbsent(org.sejda.sambox.cos.IndirectCOSObjectIdentifier id) |
boolean |
indirectLength() |
void |
indirectLength(boolean indirectLength) |
boolean |
isEmpty() |
static ReadOnlyFilteredCOSStream |
readOnly(org.sejda.sambox.cos.COSStream existing)
a
ReadOnlyFilteredCOSStream from an existing COSStream |
static ReadOnlyFilteredCOSStream |
readOnlyEmbeddedFile(Source<?> source)
a
ReadOnlyFilteredCOSStream representing an embedded file stream |
static ReadOnlyFilteredCOSStream |
readOnlyJpegImage(File imageFile,
int width,
int height,
int bitsPerComponent,
org.sejda.sambox.pdmodel.graphics.color.PDColorSpace colorSpace)
a
ReadOnlyFilteredCOSStream that represents an xobject JPEG image |
void |
setFilters(org.sejda.sambox.cos.COSBase filters) |
accept, asTextString, getDecodeResult, getFilteredSource, getFilteredStream, getFilters, getUnfilteredByteBuffer, hasFilter, setEncryptor, unDecodeaddAll, asUnmodifiableDictionary, clear, containsKey, containsKey, duplicate, entrySet, getBoolean, getBoolean, getBoolean, getCOSArray, getCOSName, getCOSName, getDate, getDate, getDate, getDate, getDictionaryObject, getDictionaryObject, 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, getItem, getItem, getItem, getKeyForValue, getLong, getLong, getLong, getLong, getNameAsString, getNameAsString, getNameAsString, getNameAsString, getString, getString, getString, getString, getValues, keySet, merge, mergeWithoutOverwriting, putIfAbsent, putIfAbsent, putIfAbsent, putIfAbsent, putIfAbsent, putIfAbsent, removeItem, removeItems, setBoolean, setBoolean, setDate, setDate, setEmbeddedDate, setEmbeddedDate, setEmbeddedInt, setEmbeddedInt, setEmbeddedString, setEmbeddedString, setFlag, setFloat, setFloat, setInt, setInt, setItem, setItem, setItem, setItem, setLong, setLong, setName, setName, setString, setString, size, toStringpublic ReadOnlyFilteredCOSStream(org.sejda.sambox.cos.COSDictionary existingDictionary,
ReadOnlyFilteredCOSStream.InputStreamSupplier<InputStream> stream,
long length)
protected InputStream doGetFilteredStream() throws IOException
doGetFilteredStream in class org.sejda.sambox.cos.COSStreamIOExceptionpublic long getFilteredLength()
throws IOException
getFilteredLength in class org.sejda.sambox.cos.COSStreamIOExceptionpublic long getUnfilteredLength()
throws IOException
getUnfilteredLength in class org.sejda.sambox.cos.COSStreamIOExceptionpublic InputStream getUnfilteredStream() throws IOException
getUnfilteredStream in class org.sejda.sambox.cos.COSStreamIOExceptionpublic org.sejda.io.SeekableSource getUnfilteredSource()
throws IOException
getUnfilteredSource in class org.sejda.sambox.cos.COSStreamIOExceptionpublic OutputStream createFilteredStream()
createFilteredStream in class org.sejda.sambox.cos.COSStreampublic OutputStream createFilteredStream(org.sejda.sambox.cos.COSBase filters)
createFilteredStream in class org.sejda.sambox.cos.COSStreampublic void setFilters(org.sejda.sambox.cos.COSBase filters)
setFilters in class org.sejda.sambox.cos.COSStreampublic boolean addCompression()
addCompression in class org.sejda.sambox.cos.COSStreampublic boolean encryptable()
encryptable in interface org.sejda.sambox.cos.Encryptableencryptable in class org.sejda.sambox.cos.COSStreampublic void encryptable(boolean encryptable)
encryptable in interface org.sejda.sambox.cos.Encryptableencryptable in class org.sejda.sambox.cos.COSStreampublic OutputStream createUnfilteredStream()
createUnfilteredStream in class org.sejda.sambox.cos.COSStreampublic boolean isEmpty()
isEmpty in class org.sejda.sambox.cos.COSStreampublic boolean indirectLength()
indirectLength in class org.sejda.sambox.cos.COSStreampublic void indirectLength(boolean indirectLength)
indirectLength in class org.sejda.sambox.cos.COSStreampublic org.sejda.sambox.cos.IndirectCOSObjectIdentifier id()
id in class org.sejda.sambox.cos.COSBasepublic void idIfAbsent(org.sejda.sambox.cos.IndirectCOSObjectIdentifier id)
idIfAbsent in class org.sejda.sambox.cos.COSBasepublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class org.sejda.sambox.cos.COSStreamIOExceptionpublic static ReadOnlyFilteredCOSStream readOnly(org.sejda.sambox.cos.COSStream existing) throws IOException
ReadOnlyFilteredCOSStream from an existing COSStreamexisting - IOExceptionpublic static ReadOnlyFilteredCOSStream readOnlyJpegImage(File imageFile, int width, int height, int bitsPerComponent, org.sejda.sambox.pdmodel.graphics.color.PDColorSpace colorSpace)
ReadOnlyFilteredCOSStream that represents an xobject JPEG imageimageFile - the image filewidth - height - bitsPerComponent - colorSpace - FileNotFoundExceptionpublic static final ReadOnlyFilteredCOSStream readOnlyEmbeddedFile(Source<?> source) throws TaskIOException
ReadOnlyFilteredCOSStream representing an embedded file streamsource - TaskIOExceptionCopyright © 2019 sejda. All rights reserved.