Package org.apache.axiom.util.base64
Class Base64EncodingWriterOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.apache.axiom.util.base64.AbstractBase64EncodingOutputStream
-
- org.apache.axiom.util.base64.Base64EncodingWriterOutputStream
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
public class Base64EncodingWriterOutputStream extends AbstractBase64EncodingOutputStream
OutputStreamimplementation that writes base64 encoded data to aWriter. This class internally buffers the data before writing it to the underlying stream.
-
-
Constructor Summary
Constructors Constructor Description Base64EncodingWriterOutputStream(Writer writer)Constructor that sets the buffer size to its default value of 4096 characters.Base64EncodingWriterOutputStream(Writer writer, int bufferSize)Constructor.Base64EncodingWriterOutputStream(Writer writer, int bufferSize, boolean ignoreFlush)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoClose()Close the underlying stream, if applicable.protected voiddoFlush()Flush the underlying stream, if applicable.protected voiddoWrite(byte[] b)Write base64 encoded data.protected voidflushBuffer()Write any pending data to the underlying stream, if applicable.-
Methods inherited from class org.apache.axiom.util.base64.AbstractBase64EncodingOutputStream
close, complete, flush, write, write
-
Methods inherited from class java.io.OutputStream
nullOutputStream, write
-
-
-
-
Constructor Detail
-
Base64EncodingWriterOutputStream
public Base64EncodingWriterOutputStream(Writer writer, int bufferSize, boolean ignoreFlush)
Constructor.- Parameters:
writer- the stream to write the encoded data tobufferSize- the buffer size to useignoreFlush- specifies if calls toAbstractBase64EncodingOutputStream.flush()should be ignored; seeAbstractBase64EncodingOutputStream(boolean)for more information
-
Base64EncodingWriterOutputStream
public Base64EncodingWriterOutputStream(Writer writer, int bufferSize)
Constructor.- Parameters:
writer- the stream to write the encoded data tobufferSize- the buffer size to use
-
Base64EncodingWriterOutputStream
public Base64EncodingWriterOutputStream(Writer writer)
Constructor that sets the buffer size to its default value of 4096 characters.- Parameters:
writer- the stream to write the encoded data to
-
-
Method Detail
-
doWrite
protected void doWrite(byte[] b) throws IOExceptionDescription copied from class:AbstractBase64EncodingOutputStreamWrite base64 encoded data. If necessary, the implementation should accumulate the data in a buffer before writing it to the underlying stream.- Specified by:
doWritein classAbstractBase64EncodingOutputStream- Parameters:
b- a byte array of length 4- Throws:
IOException- if an I/O error occurs
-
flushBuffer
protected void flushBuffer() throws IOExceptionDescription copied from class:AbstractBase64EncodingOutputStreamWrite any pending data to the underlying stream, if applicable. Note that implementations should not flush the underlying stream.- Specified by:
flushBufferin classAbstractBase64EncodingOutputStream- Throws:
IOException- if an I/O error occurs
-
doFlush
protected void doFlush() throws IOExceptionDescription copied from class:AbstractBase64EncodingOutputStreamFlush the underlying stream, if applicable.- Specified by:
doFlushin classAbstractBase64EncodingOutputStream- Throws:
IOException- if an I/O error occurs
-
doClose
protected void doClose() throws IOExceptionDescription copied from class:AbstractBase64EncodingOutputStreamClose the underlying stream, if applicable.- Specified by:
doClosein classAbstractBase64EncodingOutputStream- Throws:
IOException- if an I/O error occurs
-
-