Class javax.crypto.CipherInputStream
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class javax.crypto.CipherInputStream

java.lang.Object
   |
   +----java.io.InputStream
           |
           +----java.io.FilterInputStream
                   |
                   +----javax.crypto.CipherInputStream

public class CipherInputStream
extends FilterInputStream
A stream filter that decrypts bytes as they are read.
See Also:
StreamDecryptor

Variable Index

 o ident

Constructor Index

 o CipherInputStream(InputStream, Cipher)
Construct an SecureInputStream.

Method Index

 o close()
 o read()
Read a byte from the stream and decrypt it.
 o read(byte[])
Reads up to b.length bytes of data from this input stream into an array of bytes.
 o read(byte[], int, int)
Read an array of bytes from the stream and decrypt them.

Variables

 o ident
  public final static String ident

Constructors

 o CipherInputStream
  public CipherInputStream(InputStream in,
                           Cipher cipher)
Construct an SecureInputStream.
Parameters:
in - The input stream to decrypt.
cipher - The decrypting/encrypting object.

Methods

 o read
  public int read() throws IOException
Read a byte from the stream and decrypt it. This will block if no byte is available.
Returns:
The decrypted next byte from the stream, or -1 if the end of the stream has been reached.
Throws: IOException
If the byte cannot be decrypted or an I/O error occurs.
Overrides:
read in class FilterInputStream
 o read
  public int read(byte b[]) throws IOException
Reads up to b.length bytes of data from this input stream into an array of bytes. The read method of InputStream calls the read method of three arguments with the arguments b, 0, and b.length.
Overrides:
read in class FilterInputStream
 o read
  public int read(byte b[],
                  int off,
                  int len) throws IOException
Read an array of bytes from the stream and decrypt them. If no bytes are available, this will block until at least one byte can be read.
Parameters:
b - The byte[] to read into.
off - The index within the byte[] to place data.
len - The maximum number of bytes to read.
Returns:
The number of bytes actually read.
Throws: IOException
If any byte cannot be decrypted or an I/O error occurs.
Overrides:
read in class FilterInputStream
 o close
  public void close() throws IOException
Overrides:
close in class FilterInputStream

All Packages  Class Hierarchy  This Package  Previous  Next  Index