|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.InputStream
java.io.FilterInputStream
javax.crypto.CipherInputStream
public class CipherInputStream
This is an InputStream that filters its data
through a Cipher before returning it. The Cipher
argument must have been initialized before it is passed to the
constructor.
| Field Summary |
|---|
| Fields inherited from class java.io.FilterInputStream |
|---|
in |
| Constructor Summary | |
|---|---|
protected |
CipherInputStream(InputStream in)
Creates a new input stream without a cipher. |
|
CipherInputStream(InputStream in,
Cipher cipher)
Creates a new input stream with a source input stream and 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 #mark(long) and 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)
Read bytes into an array, returning the number of bytes read or -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. |
void |
reset()
Reset to the mark. |
long |
skip(long bytes)
Skip a number of bytes. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CipherInputStream(InputStream in,
Cipher cipher)
in - The underlying input stream.cipher - The cipher to filter data through.protected CipherInputStream(InputStream in)
protected because this class does not work without an
underlying cipher.
in - The underlying input stream.| Method Detail |
|---|
public int available()
throws IOException
available in class FilterInputStreamIOException - If an I/O exception occurs.
public void close()
throws IOException
InputStream.close() method of the underlying input stream.
close in interface Closeableclose in class FilterInputStreamIOException - If an I/O exception occurs.
public int read()
throws IOException
read in class FilterInputStreamjava.io.IOExcpetion - If an I/O exception occurs.
IOException - If an error occurs
public int read(byte[] buf,
int off,
int len)
throws IOException
read in class FilterInputStreambuf - The byte array to read into.off - The offset in buf to start.len - The maximum number of bytes to read.
IOException - If an I/O exception occurs.
public int read(byte[] buf)
throws IOException
read in class FilterInputStreambuf - The byte arry to read into.
IOException - If an I/O exception occurs.
public long skip(long bytes)
throws IOException
available(), which is the number
of transformed bytes currently in this class's internal buffer.
skip in class FilterInputStreambytes - The number of bytes to skip.
IOException - If an error occurspublic boolean markSupported()
#mark(long) and reset() methods; this input stream does
not, however, and invariably returns false.
markSupported in class FilterInputStreamfalsepublic void mark(int mark)
mark in class FilterInputStreammark - Is ignored.
public void reset()
throws IOException
reset in class FilterInputStreamIOException - If an error occurs
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||