Top Description Fields Constructors Methods
org.apache.pdfbox.cos

public final Class COSOutputStream

extends FilterOutputStream
Class Inheritance
Imports
java.io.FilterOutputStream, .IOException, .InputStream, .OutputStream, java.util.List, org.apache.pdfbox.filter.Filter, org.apache.pdfbox.io.RandomAccess, .RandomAccessInputStream, .RandomAccessOutputStream, .RandomAccessStreamCache

An OutputStream which writes to an encoded COS stream.
Author
John Hewson

Field Summary

Modifier and TypeField and Description
private RandomAccess
private final List<Filter>
private final COSDictionary
private final RandomAccessStreamCache
Inherited from java.io.FilterOutputStream:
out

Constructor Summary

AccessConstructor and Description
pack-priv
COSOutputStream(List<Filter>
Filters to apply.
filters
,
COSDictionary
Filter parameters.
parameters
,
OutputStream
Encoded stream.
output
,
RandomAccessStreamCache
Stream cache to use.
streamCache
)

Creates a new COSOutputStream writes to an encoded COS stream.

Method Summary

Modifier and TypeMethod and Description
public void
close()

Overrides java.io.FilterOutputStream.close.

Implements java.io.Closeable.close.

Closes this output stream and releases any system resources associated with the stream.

public void
flush()

Overrides java.io.FilterOutputStream.flush.

Implements java.io.Flushable.flush.

Flushes this output stream and forces any buffered output bytes to be written out to the stream.

public void
write(byte[]
the data to be written.
b
)

Overrides java.io.FilterOutputStream.write.

Writes b.length bytes to this output stream.

public void
write(byte[]
the data.
b
,
int
the start offset in the data.
off
,
int
the number of bytes to write.
len
)

Overrides java.io.FilterOutputStream.write.

Writes len bytes from the specified byte array starting at offset off to this output stream.

public void
write(int
the byte.
b
)

Overrides java.io.FilterOutputStream.write.

Writes the specified byte to this output stream.

Field Detail

bufferback to summary
private RandomAccess buffer
filtersback to summary
private final List<Filter> filters
parametersback to summary
private final COSDictionary parameters
streamCacheback to summary
private final RandomAccessStreamCache streamCache

Constructor Detail

COSOutputStreamback to summary
pack-priv COSOutputStream(List<Filter> filters, COSDictionary parameters, OutputStream output, RandomAccessStreamCache streamCache) throws IOException

Creates a new COSOutputStream writes to an encoded COS stream.

Parameters
filters:List<Filter>

Filters to apply.

parameters:COSDictionary

Filter parameters.

output:OutputStream

Encoded stream.

streamCache:RandomAccessStreamCache

Stream cache to use.

Exceptions
IOException:
If there was an error creating a temporary buffer

Method Detail

closeback to summary
public void close() throws IOException

Overrides java.io.FilterOutputStream.close.

Implements java.io.Closeable.close.

Doc from java.io.FilterOutputStream.close.

Closes this output stream and releases any system resources associated with the stream.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
flushback to summary
public void flush() throws IOException

Overrides java.io.FilterOutputStream.flush.

Implements java.io.Flushable.flush.

Doc from java.io.FilterOutputStream.flush.

Flushes this output stream and forces any buffered output bytes to be written out to the stream.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
writeback to summary
public void write(byte[] b) throws IOException

Overrides java.io.FilterOutputStream.write.

Doc from java.io.FilterOutputStream.write.

Writes b.length bytes to this output stream.

Parameters
b:byte[]

the data to be written.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
writeback to summary
public void write(byte[] b, int off, int len) throws IOException

Overrides java.io.FilterOutputStream.write.

Doc from java.io.FilterOutputStream.write.

Writes len bytes from the specified byte array starting at offset off to this output stream.

Parameters
b:byte[]

the data.

off:int

the start offset in the data.

len:int

the number of bytes to write.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
writeback to summary
public void write(int b) throws IOException

Overrides java.io.FilterOutputStream.write.

Doc from java.io.FilterOutputStream.write.

Writes the specified byte to this output stream.

The write method of FilterOutputStream calls the write method of its underlying output stream, that is, it performs out.write(b).

Implements the abstract write method of OutputStream.

Parameters
b:int

the byte.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.