Project JXTA

net.jxta.impl.util
Class BASE64OutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended bynet.jxta.impl.util.BASE64OutputStream

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 BodiesW

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

Throws:
IOException

close

public void close()
           throws IOException

The output writer is NOT closed.

Throws:
IOException

flush

public void flush()
           throws IOException

Throws:
IOException

JXTA J2SE