org.apache.pdfbox.pdfwriter

## Class ContentStreamWriter

- java.lang.Object
- - org.apache.pdfbox.pdfwriter.ContentStreamWriter

    public class ContentStreamWriter
    extends Object

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

Author:
  Ben Litchfield

### Field Summary

Fields
`static byte[]` `EOL` standard line separator
`static byte[]` `SPACE` space character.

### Constructor Summary

Constructors
Constructor and Description
`ContentStreamWriter(OutputStream out)` This will create a new content stream writer.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `writeToken(COSBase base)` Writes a single operand token.
`void` `writeToken(Operator op)` Writes a single operator token.
`void` `writeTokens(List<?> tokens)` This will write out the list of tokens to the stream.
`void` `writeTokens(Object... tokens)` Writes a series of tokens followed by a new line.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### SPACE

    public static final byte[] SPACE

space character.

#### EOL

    public static final byte[] EOL

standard line separator

### Constructor Detail

#### ContentStreamWriter

    public ContentStreamWriter(OutputStream out)

This will create a new content stream writer.

Parameters:
  `out` - The stream to write the data to.

### Method Detail

#### writeToken

    public void writeToken(COSBase base)
                    throws IOException

Writes a single operand token.

Parameters:
  `base` - The operand to write to the stream.
Throws:
  `IOException` - If there is an error writing to the stream.

#### writeToken

    public void writeToken(Operator op)
                    throws IOException

Writes a single operator token.

Parameters:
  `op` - The operator to write to the stream.
Throws:
  `IOException` - If there is an error writing to the stream.

#### writeTokens

    public void writeTokens(Object... tokens)
                     throws IOException

Writes a series of tokens followed by a new line.

Parameters:
  `tokens` - The tokens to write to the stream.
Throws:
  `IOException` - If there is an error writing to the stream.

#### writeTokens

    public void writeTokens(List<?> tokens)
                     throws IOException

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

Parameters:
  `tokens` - The tokens to write to the stream.
Throws:
  `IOException` - If there is an error writing to the stream.