org.bouncycastle.crypto.io
Class CipherInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.bouncycastle.crypto.io.CipherInputStream
- All Implemented Interfaces:
- java.io.Closeable
public class CipherInputStream
- extends java.io.FilterInputStream
A CipherInputStream is composed of an InputStream and a BufferedBlockCipher so
that read() methods return data that are read in from the
underlying InputStream but have been additionally processed by the
Cipher. The Cipher must be fully initialized before being used by
a CipherInputStream.
For example, if the Cipher is initialized for decryption, the
CipherInputStream will attempt to read in data and decrypt them,
before returning the decrypted data.
| Fields inherited from class java.io.FilterInputStream |
in |
| Methods inherited from class java.io.FilterInputStream |
mark, reset |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CipherInputStream
public CipherInputStream(java.io.InputStream is,
BufferedBlockCipher cipher)
- Constructs a CipherInputStream from an InputStream and a
BufferedBlockCipher.
CipherInputStream
public CipherInputStream(java.io.InputStream is,
StreamCipher cipher)
read
public int read()
throws java.io.IOException
- Overrides:
read in class java.io.FilterInputStream
- Throws:
java.io.IOException
read
public int read(byte[] b)
throws java.io.IOException
- Overrides:
read in class java.io.FilterInputStream
- Throws:
java.io.IOException
read
public int read(byte[] b,
int off,
int len)
throws java.io.IOException
- Overrides:
read in class java.io.FilterInputStream
- Throws:
java.io.IOException
skip
public long skip(long n)
throws java.io.IOException
- Overrides:
skip in class java.io.FilterInputStream
- Throws:
java.io.IOException
available
public int available()
throws java.io.IOException
- Overrides:
available in class java.io.FilterInputStream
- Throws:
java.io.IOException
close
public void close()
throws java.io.IOException
- Specified by:
close in interface java.io.Closeable- Overrides:
close in class java.io.FilterInputStream
- Throws:
java.io.IOException
markSupported
public boolean markSupported()
- Overrides:
markSupported in class java.io.FilterInputStream