public class CipherInputStream
extends java.io.FilterInputStream
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.
Modifier and Type | Field and Description |
---|---|
private byte[] |
buf |
private BufferedBlockCipher |
bufferedBlockCipher |
private int |
bufOff |
private boolean |
finalized |
private byte[] |
inBuf |
private static int |
INPUT_BUF_SIZE |
private int |
maxBuf |
private StreamCipher |
streamCipher |
Constructor and Description |
---|
CipherInputStream(java.io.InputStream is,
BufferedBlockCipher cipher)
Constructs a CipherInputStream from an InputStream and a
BufferedBlockCipher.
|
CipherInputStream(java.io.InputStream is,
StreamCipher cipher) |
private BufferedBlockCipher bufferedBlockCipher
private StreamCipher streamCipher
private byte[] buf
private byte[] inBuf
private int bufOff
private int maxBuf
private boolean finalized
private static final int INPUT_BUF_SIZE
public CipherInputStream(java.io.InputStream is, BufferedBlockCipher cipher)
public CipherInputStream(java.io.InputStream is, StreamCipher cipher)
private int nextChunk() throws java.io.IOException
java.io.IOException
public int read() throws java.io.IOException
read
in class java.io.FilterInputStream
java.io.IOException
public int read(byte[] b) throws java.io.IOException
read
in class java.io.FilterInputStream
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.FilterInputStream
java.io.IOException
public long skip(long n) throws java.io.IOException
skip
in class java.io.FilterInputStream
java.io.IOException
public int available() throws java.io.IOException
available
in class java.io.FilterInputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.FilterInputStream
java.io.IOException
public boolean markSupported()
markSupported
in class java.io.FilterInputStream