JXTA

net.jxta.impl.util
Class BASE64OutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by net.jxta.impl.util.BASE64OutputStream
All Implemented Interfaces:
Closeable, Flushable

public class BASE64OutputStream
extends OutputStream

An OutputStream implementation which encodes the written bytes into BASE64 encoded character data and writes the output to an associated text Writer.

This implementation is not thread safe.

See Also:
BASE64InputStream, IETF RFC 2045 MIME : Format of Internet Message Bodies

Field Summary
(package private) static char[] encode
          BASE64 Encoding Table
 
Constructor Summary
BASE64OutputStream(Writer sendTo)
          Construct a BASE64 Output Stream.
BASE64OutputStream(Writer sendTo, int columnWidth)
          Construct a BASE64 Output Stream.
 
Method Summary
 void close()
          

The output writer is NOT closed.

 void flush()
          
 void write(int b)
          
 
Methods inherited from class java.io.OutputStream
write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

encode

static final char[] encode
BASE64 Encoding Table

Constructor Detail

BASE64OutputStream

public BASE64OutputStream(Writer sendTo)
Construct a BASE64 Output Stream.

Parameters:
sendTo - The text Writer to which the BASE64 output will be written.

BASE64OutputStream

public BASE64OutputStream(Writer sendTo,
                          int columnWidth)
Construct a BASE64 Output Stream. The output will be broken into lines columnWidth long.

Parameters:
sendTo - The text Writer to which the BASE64 output will be written.
columnWidth - The width of lines to break output into.
Method Detail

write

public void write(int b)
           throws IOException

Specified by:
write in class OutputStream
Throws:
IOException

close

public void close()
           throws IOException

The output writer is NOT closed.

Specified by:
close in interface Closeable
Overrides:
close in class OutputStream
Throws:
IOException

flush

public void flush()
           throws IOException

Specified by:
flush in interface Flushable
Overrides:
flush in class OutputStream
Throws:
IOException

JXSE