javax.crypto
public class CipherInputStream extends FilterInputStream
Cipher
argument must have been initialized before it is passed to the
constructor.
Constructor Summary | |
---|---|
CipherInputStream(InputStream in, Cipher cipher)
Creates a new input stream with a source input stream and cipher.
| |
protected | CipherInputStream(InputStream in)
Creates a new input stream without a cipher. |
Method Summary | |
---|---|
int | available()
Returns the number of bytes available without blocking. |
void | close()
Close this input stream. |
void | mark(int mark)
Set the mark. |
boolean | markSupported()
Returns whether or not this input stream supports the {@link
#mark(long)} and {@link #reset()} methods; this input stream does
not, however, and invariably returns false .
|
int | read()
Read a single byte from this input stream; returns -1 on the
end-of-file.
|
int | read(byte[] buf, int off, int len)
Read bytes into an array, returning the number of bytes read or -1
on the end-of-file.
|
int | read(byte[] buf)
Read bytes into an array, returning the number of bytes read or -1
on the end-of-file.
|
void | reset()
Reset to the mark. |
long | skip(long bytes)
Skip a number of bytes. |
Parameters: in The underlying input stream. cipher The cipher to filter data through.
protected
because this class does not work without an
underlying cipher.
Parameters: in The underlying input stream.
Returns: The number of bytes immediately available.
Throws: java.io.IOException If an I/O exception occurs.
Throws: java.io.IOException If an I/O exception occurs.
Parameters: mark Is ignored.
false
.
Returns: false
Returns: The byte read, or -1 if there are no more bytes.
Throws: java.io.IOExcpetion If an I/O exception occurs.
Parameters: buf The byte array to read into. off The offset in buf
to start. len The maximum number of bytes to read.
Returns: The number of bytes read, or -1 on the end-of-file.
Throws: java.io.IOException If an I/O exception occurs.
Parameters: buf The byte arry to read into.
Returns: The number of bytes read, or -1 on the end-of-file.
Throws: java.io.IOException If an I/O exception occurs.
Parameters: bytes The number of bytes to skip.
Returns: The number of bytes skipped.