All Packages Class Hierarchy This Package Previous Next Index
Class iaik.utils.ReplaceInputStream
java.lang.Object
|
+----java.io.InputStream
|
+----java.io.FilterInputStream
|
+----iaik.utils.ReplaceInputStream
- public synchronized class ReplaceInputStream
- extends FilterInputStream
-
ReplaceInputStream(InputStream, String[][])
- Constructs an input stream using a cipher that must be
initialized for either encryption or decryption, that is, a
cipher whose state is either
ENCRYPT or
DECRYPT.
-
read()
- Returns the next encrypted or decrypted byte, depending on the
cipher state.
-
read(byte[], int, int)
- Fills up the specified bytes of the
b array with the
next len encrypted or decrypted bytes
(depending on the cipher state).
ReplaceInputStream
public ReplaceInputStream(InputStream is,
String replace[][])
- Constructs an input stream using a cipher that must be
initialized for either encryption or decryption, that is, a
cipher whose state is either
ENCRYPT or
DECRYPT.
- Parameters:
- is - - the input stream.
- cipher - - an initialized cipher.
- See Also:
- Cipher
read
public int read(byte b[],
int off,
int len) throws IOException
- Fills up the specified bytes of the
b array with the
next len encrypted or decrypted bytes
(depending on the cipher state).
- Parameters:
- b - - the byte array into which the encrypted or decrypted bytes
will be read.
- off - - the offset into
b indicating where the
first encrypted or decrypted byte should be read.
- len - - the number of encrypted/decrypted bytes to
read into
b, starting at offset off.
- Returns:
- the number of bytes read into
b, or -1 if
fewer than len encrypted/decrypted bytes remained.
- Throws: IOException
- if an error occurs.
- Overrides:
- read in class FilterInputStream
read
public int read() throws IOException
- Returns the next encrypted or decrypted byte, depending on the
cipher state.
- Returns:
- the next encrypted or decrypted byte, or -1 if the
last encrypted/decrypted byte was already returned.
- Throws: IOException
- if an error occurs.
- Overrides:
- read in class FilterInputStream
All Packages Class Hierarchy This Package Previous Next Index