public class ASCII85Encoder
extends java.lang.Object
The ASCII85encoding is suitable when binary data needs to be transmitted or stored as text. It has been defined by Adobe for the PostScript and PDF formats (see PDF Reference, section 3.3 Details of Filtered Streams).
The encoded stream is about 25% larger than the corresponding binary stream (32 binary bits are converted into 40 encoded bits, and there may be start/end of line markers).
Constructor and Description |
---|
ASCII85Encoder(Stream out)
Create an encoder wrapping a sink of binary data.
|
ASCII85Encoder(Stream out,
int lineLength,
byte[] sol,
byte[] eol)
Create an encoder wrapping a sink of binary data.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this output stream and releases any system resources associated with the stream.
|
void |
write(int b)
Writes the specified byte to this output stream.
|
public ASCII85Encoder(Stream out)
out
- sink of binary data to filterpublic ASCII85Encoder(Stream out, int lineLength, byte[] sol, byte[] eol)
The additional arguments allow to specify some text formatting
Note that specifying a negative number for lineLength
is really equivalent to calling the one
argument.
If non-null start/end of line are used, they must contain only whitespace characters as other characters would otherwise interfere with the decoding process on the other side of the channel. For safety, it is recommended to stick to space (' ', 0x32) and horizontal tabulation ('\t', 0x9) characters for the start of line marker, and to line feed ('\n', 0xa) and carriage return ('\r', 0xd) characters according to the platform convention for the end of line marker.
out
- sink of binary data to filterlineLength
- maximal length of a ligne (counting sol
but not counting eol
), if
negative lines will not be splitsol
- start of line marker to use (mainly for indentation purposes), may be nulleol
- end of line marker to use, may be null only if lineLength
is negativepublic void close() throws IOException
IOException
public void write(int b) throws IOException
b
- byte to write (only the 8 low order bits are used)IOException