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

public Class ContentStreamWriter

extends Object
Class Inheritance
Imports
java.io.IOException, .OutputStream, java.nio.charset.StandardCharsets, java.util.List, .Map, org.apache.pdfbox.contentstream.operator.Operator, .OperatorName, org.apache.pdfbox.cos.COSArray, .COSBase, .COSBoolean, .COSDictionary, .COSFloat, .COSInteger, .COSName, .COSNull, .COSString

A class that will take a list of tokens and write out a stream with them.
Author
Ben Litchfield

Field Summary

Modifier and TypeField and Description
public static final byte[]
EOL

standard line separator

private final OutputStream
public static final byte[]
SPACE

space character.

Constructor Summary

AccessConstructor and Description
public
ContentStreamWriter(OutputStream
The stream to write the data to.
out
)

This will create a new content stream writer.

Method Summary

Modifier and TypeMethod and Description
private void
private void
private void
public void
writeToken(COSBase
The operand to write to the stream.
base
)

Writes a single operand token.

public void
writeToken(Operator
The operator to write to the stream.
op
)

Writes a single operator token.

public void
writeTokens(Object...
The tokens to write to the stream.
tokens
)

Writes a series of tokens followed by a new line.

public void
writeTokens(List<?>
The tokens to write to the stream.
tokens
)

This will write out the list of tokens to the stream.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

EOLback to summary
public static final byte[] EOL

standard line separator

outputback to summary
private final OutputStream output
SPACEback to summary
public static final byte[] SPACE

space character.

Constructor Detail

ContentStreamWriterback to summary
public ContentStreamWriter(OutputStream out)

This will create a new content stream writer.

Parameters
out:OutputStream

The stream to write the data to.

Method Detail

writeObjectback to summary
private void writeObject(Object o) throws IOException
writeObjectback to summary
private void writeObject(Operator op) throws IOException
writeObjectback to summary
private void writeObject(COSBase o) throws IOException
writeTokenback to summary
public void writeToken(COSBase base) throws IOException

Writes a single operand token.

Parameters
base:COSBase

The operand to write to the stream.

Exceptions
IOException:
If there is an error writing to the stream.
writeTokenback to summary
public void writeToken(Operator op) throws IOException

Writes a single operator token.

Parameters
op:Operator

The operator to write to the stream.

Exceptions
IOException:
If there is an error writing to the stream.
writeTokensback to summary
public void writeTokens(Object... tokens) throws IOException

Writes a series of tokens followed by a new line.

Parameters
tokens:Object[]

The tokens to write to the stream.

Exceptions
IOException:
If there is an error writing to the stream.
writeTokensback to summary
public void writeTokens(List<?> tokens) throws IOException

This will write out the list of tokens to the stream.

Parameters
tokens:List<?>

The tokens to write to the stream.

Exceptions
IOException:
If there is an error writing to the stream.