com.ibm.security.certclient.util

Class PkBase64InputStream

  1. java.lang.Object
  2. extended byjava.io.InputStream
  3. extended bycom.ibm.security.certclient.util.PkBase64InputStream
All implemented interfaces:
Closeable

  1. public class PkBase64InputStream
  2. extends InputStream
This class converts an input stream that has a base-64 encoded stream to its original stream. Because base-64 does not have any indication of when the end of the base 64-encoded value is reached, this class relies on having a non base-64 byte follow the base-64 encoding, or on having the base-64 encoding be followed by an end of input. The possible invalid byte (usually '-') is then consumed and the caller must call the lastChar() method in order to retrieve the extra byte that is consumed by this class.
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
PkBase64InputStream(InputStream in)

Method Summary

Modifier and Type Method and Description
  1. void
close()
  1. int
lastChar()
Returns the extra byte consumed by this InpuStream.
  1. int
read()
Methods inherited from class java.io.InputStream
available, mark, markSupported, read, read, reset, skip
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

PkBase64InputStream

  1. public PkBase64InputStream(InputStream in)
  2. throws IOException
Throws:

Method Detail

read

  1. public int read()
  2. throws IOException
Specified by:
read in class InputStream
Throws:

close

  1. public void close()
  2. throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class InputStream
Throws:

lastChar

  1. public int lastChar()
Returns the extra byte consumed by this InpuStream. This method should be called only after read() returns -1. If this method then also returns -1, the end of input was reached. Otherwise, there may be more bytes in the input.