Package org.apache.pdfbox.cos
Class COSOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- org.apache.pdfbox.cos.COSOutputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
public final class COSOutputStream extends java.io.FilterOutputStreamAn OutputStream which writes to an encoded COS stream.
-
-
Field Summary
Fields Modifier and Type Field Description private RandomAccessbufferprivate java.util.List<Filter>filtersprivate COSDictionaryparametersprivate RandomAccessStreamCachestreamCache
-
Constructor Summary
Constructors Constructor Description COSOutputStream(java.util.List<Filter> filters, COSDictionary parameters, java.io.OutputStream output, RandomAccessStreamCache streamCache)Creates a new COSOutputStream writes to an encoded COS stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()voidwrite(byte[] b)voidwrite(byte[] b, int off, int len)voidwrite(int b)
-
-
-
Field Detail
-
filters
private final java.util.List<Filter> filters
-
parameters
private final COSDictionary parameters
-
streamCache
private final RandomAccessStreamCache streamCache
-
buffer
private RandomAccess buffer
-
-
Constructor Detail
-
COSOutputStream
COSOutputStream(java.util.List<Filter> filters, COSDictionary parameters, java.io.OutputStream output, RandomAccessStreamCache streamCache) throws java.io.IOException
Creates a new COSOutputStream writes to an encoded COS stream.- Parameters:
filters- Filters to apply.parameters- Filter parameters.output- Encoded stream.streamCache- Stream cache to use.- Throws:
java.io.IOException- If there was an error creating a temporary buffer
-
-
Method Detail
-
write
public void write(byte[] b) throws java.io.IOException- Overrides:
writein classjava.io.FilterOutputStream- Throws:
java.io.IOException
-
write
public void write(byte[] b, int off, int len) throws java.io.IOException- Overrides:
writein classjava.io.FilterOutputStream- Throws:
java.io.IOException
-
write
public void write(int b) throws java.io.IOException- Overrides:
writein classjava.io.FilterOutputStream- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException- Specified by:
flushin interfacejava.io.Flushable- Overrides:
flushin classjava.io.FilterOutputStream- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.FilterOutputStream- Throws:
java.io.IOException
-
-