info.aduna.gee.publication.util
Class Base64OutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by info.aduna.gee.publication.util.Base64OutputStream
All Implemented Interfaces:
Closeable, Flushable

public class Base64OutputStream
extends FilterOutputStream

Implements a Base64-Compressed output 'stream'.


Field Summary
protected  byte[] bytesBehind
           
protected  String delimeter
           
protected  byte[] encodedBytes
           
protected  byte[] encodeTab
           
protected  int noBytesBehind
           
protected  byte PADCHAR
           
protected  int totalNumberOfBytes
           
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
Base64OutputStream(OutputStream outst, String delim)
          Creates a Base64 OutputStream.
 
Method Summary
 void close()
          Close the output.
protected  void encode(byte[] bytes, int realBytes)
          Encode the three bytes in bytesBehind.
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 
Methods inherited from class java.io.FilterOutputStream
flush, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PADCHAR

protected byte PADCHAR

encodeTab

protected byte[] encodeTab

bytesBehind

protected byte[] bytesBehind

noBytesBehind

protected int noBytesBehind

encodedBytes

protected byte[] encodedBytes

totalNumberOfBytes

protected int totalNumberOfBytes

delimeter

protected String delimeter
Constructor Detail

Base64OutputStream

public Base64OutputStream(OutputStream outst,
                          String delim)
Creates a Base64 OutputStream.

Parameters:
outst - the underlying output stream.
the - block delimeter (try "\r\n").
Method Detail

write

public void write(int b)
           throws IOException
Overrides:
write in class FilterOutputStream
Throws:
IOException

write

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

close

public void close()
           throws IOException
Close the output.

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

encode

protected void encode(byte[] bytes,
                      int realBytes)
               throws IOException
Encode the three bytes in bytesBehind.

Throws:
IOException


Copyright © 1997-2008 Aduna. All Rights Reserved.