public class Base64EncodingWriterOutputStream extends AbstractBase64EncodingOutputStream
OutputStream implementation that writes base64 encoded data to a Writer.
This class internally buffers the data before writing it to the underlying stream.| Modifier and Type | Field and Description |
|---|---|
private char[] |
buffer |
private int |
len |
private java.io.Writer |
writer |
| Constructor and Description |
|---|
Base64EncodingWriterOutputStream(java.io.Writer writer)
Constructor that sets the buffer size to its default value of 4096 characters.
|
Base64EncodingWriterOutputStream(java.io.Writer writer,
int bufferSize)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
doClose()
Close the underlying stream, if applicable.
|
protected void |
doFlush()
Flush the underlying stream, if applicable.
|
protected void |
doWrite(byte[] b)
Write base64 encoded data.
|
protected void |
flushBuffer()
Write any pending data to the underlying stream, if applicable.
|
private final java.io.Writer writer
private final char[] buffer
private int len
public Base64EncodingWriterOutputStream(java.io.Writer writer,
int bufferSize)
writer - the stream to write the encoded data tobufferSize - the buffer size to usepublic Base64EncodingWriterOutputStream(java.io.Writer writer)
writer - the stream to write the encoded data toprotected void doWrite(byte[] b)
throws java.io.IOException
AbstractBase64EncodingOutputStreamdoWrite in class AbstractBase64EncodingOutputStreamb - a byte array of length 4java.io.IOException - if an I/O error occursprotected void flushBuffer()
throws java.io.IOException
AbstractBase64EncodingOutputStreamflushBuffer in class AbstractBase64EncodingOutputStreamjava.io.IOException - if an I/O error occursprotected void doFlush()
throws java.io.IOException
AbstractBase64EncodingOutputStreamdoFlush in class AbstractBase64EncodingOutputStreamjava.io.IOException - if an I/O error occursprotected void doClose()
throws java.io.IOException
AbstractBase64EncodingOutputStreamdoClose in class AbstractBase64EncodingOutputStreamjava.io.IOException - if an I/O error occurs