com.ibm.security.certclient.util

Class PkBase64OutputStream

  1. java.lang.Object
  2. extended byjava.io.OutputStream
  3. extended bycom.ibm.security.certclient.util.PkBase64OutputStream
All implemented interfaces:
Closeable, Flushable

  1. public class PkBase64OutputStream
  2. extends OutputStream
This class creates an output stream that accepts an arbitrary sequence of bytes, and passes its base-64 encoding to the output stream it wraps. Because base-64 encoding produces more bytes than it consumes and may need to keep an accumulation of up to 4 bits from previous bytes, it is necessary to tell the instance of this class that the base-64 encoding is finished for it to terminate the output (with a possible anexation of several bytes to the output stream). this is done with by invoking the end() method.

Restriction: not thread-safe.

Author:
Rod Mancisidor

Field Summary

Modifier and Type Field and Description
  1. static
  2. char[]
base64Values
Provides the character to value map based on RFC1521.
  1. static
  2. String
sccsid

Constructor Summary

Constructor and Description
PkBase64OutputStream(OutputStream out)

Method Summary

Modifier and Type Method and Description
  1. void
end()
This is similar to flush().
  1. void
write(int b)
Methods inherited from class java.io.OutputStream
close, flush, write, write
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

sccsid

  1. public static final String sccsid
See Also:

base64Values

  1. public static final char[] base64Values
Provides the character to value map based on RFC1521.

Constructor Detail

PkBase64OutputStream

  1. public PkBase64OutputStream(OutputStream out)
  2. throws IOException
Throws:

Method Detail

write

  1. public void write(int b)
  2. throws IOException
Specified by:
write in class OutputStream
Throws:

end

  1. public void end()
  2. throws IOException
This is similar to flush(). You must call it once you are done writing the base 64 encoded stream. It adds the possible terminating equal signs to the base 64 encoding and a terminating newline if necessary. Unlike flush(), this method should be called only once.
Throws: