Jetif v1.8.0

jetif.ext
Class Base64OutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended byjetif.ext.Base64OutputStream

public class Base64OutputStream
extends OutputStream

A Base64OutputStream is an output stream for encoding data to Base64 encoding (see RFC2045). NOTICE: Don't forgot to call close() when all data was send, otherwise may cause data losing problem.

Author:
Vicky Wang

Constructor Summary
Base64OutputStream(Writer writer)
          Construct from a underlying writer object.
 
Method Summary
 void close()
          Finish the encoding stream, output padding characters if needed, close the underlying writer.
 void finish()
          Finish the encoding stream, output padding characters if needed.
 void flush()
          Flush the underlying writer.
 void write(byte[] b, int off, int len)
           
 void write(int b)
          Output a byte to this output stream.
 
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

Base64OutputStream

public Base64OutputStream(Writer writer)
Construct from a underlying writer object. All encoded data will send to that writer.

Parameters:
writer - the writer to output the encoded data.
Method Detail

write

public void write(int b)
           throws IOException
Output a byte to this output stream.

Parameters:
b - the byte to be wrote, only lower 8 bits will be used.
Throws:
IOException - if I/O error occurs.

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException
Throws:
IOException

finish

public void finish()
            throws IOException
Finish the encoding stream, output padding characters if needed. Call this method only if you want to finish the encoding while not close the underlying writer.

Throws:
IOException - if I/O error occurs.

close

public void close()
           throws IOException
Finish the encoding stream, output padding characters if needed, close the underlying writer.

Throws:
IOException - if I/O error occurs.

flush

public void flush()
           throws IOException
Flush the underlying writer.

Throws:
IOException

Jetif v1.8.0

Copyright © 2004,2005 Vicky Wang - All Rights Reserved.