org.apache.axiom.util.base64
Class AbstractBase64EncodingOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by org.apache.axiom.util.base64.AbstractBase64EncodingOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable
Direct Known Subclasses:
Base64EncodingStringBufferOutputStream, Base64EncodingWriterOutputStream

public abstract class AbstractBase64EncodingOutputStream
extends java.io.OutputStream

Base class for OutputStream implementations that encode data in base64.


Constructor Summary
AbstractBase64EncodingOutputStream()
           
 
Method Summary
 void close()
           
 void complete()
          Write out any pending data, including padding if necessary.
protected abstract  void doClose()
          Close the underlying stream, if applicable.
protected abstract  void doFlush()
          Flush the underlying stream, if applicable.
protected abstract  void doWrite(byte[] b)
          Write base64 encoded data.
 void flush()
           
protected abstract  void flushBuffer()
          Write any pending data to the underlying stream, if applicable.
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 
Methods inherited from class java.io.OutputStream
write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractBase64EncodingOutputStream

public AbstractBase64EncodingOutputStream()
Method Detail

write

public final void write(byte[] b,
                        int off,
                        int len)
                 throws java.io.IOException
Overrides:
write in class java.io.OutputStream
Throws:
java.io.IOException

write

public final void write(int b)
                 throws java.io.IOException
Specified by:
write in class java.io.OutputStream
Throws:
java.io.IOException

complete

public final void complete()
                    throws java.io.IOException
Write out any pending data, including padding if necessary.

Throws:
java.io.IOException - if an I/O error occurs

flush

public final void flush()
                 throws java.io.IOException
Specified by:
flush in interface java.io.Flushable
Overrides:
flush in class java.io.OutputStream
Throws:
java.io.IOException

close

public final void close()
                 throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.OutputStream
Throws:
java.io.IOException

doWrite

protected abstract void doWrite(byte[] b)
                         throws java.io.IOException
Write base64 encoded data. If necessary, the implementation should accumulate the data in a buffer before writing it to the underlying stream.

Parameters:
b - a byte array of length 4
Throws:
java.io.IOException - if an I/O error occurs

flushBuffer

protected abstract void flushBuffer()
                             throws java.io.IOException
Write any pending data to the underlying stream, if applicable. Note that implementations should not flush the underlying stream.

Throws:
java.io.IOException - if an I/O error occurs

doFlush

protected abstract void doFlush()
                         throws java.io.IOException
Flush the underlying stream, if applicable.

Throws:
java.io.IOException - if an I/O error occurs

doClose

protected abstract void doClose()
                         throws java.io.IOException
Close the underlying stream, if applicable.

Throws:
java.io.IOException - if an I/O error occurs


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.