|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.InputStream
rice.p2p.util.EncryptedInputStream
public class EncryptedInputStream
| Field Summary | |
|---|---|
protected byte[] |
buffer
|
protected int |
bufferLength
|
protected byte[] |
key
|
protected PrivateKey |
privateKey
|
protected DataInputStream |
stream
|
| Constructor Summary | |
|---|---|
EncryptedInputStream(PrivateKey privateKey,
InputStream stream)
Builds an encrypted inputstream given a private key to decrypt thing under |
|
| Method Summary | |
|---|---|
int |
available()
Returns the number of bytes that can be read (or skipped over) from this input stream without blocking by the next caller of a method for this input stream. |
void |
close()
Closes this input stream and releases any system resources associated with the stream. |
int |
read()
Reads the next byte of data from the input stream. |
int |
read(byte[] b,
int off,
int len)
Reads up to len bytes of data from the input stream into
an array of bytes. |
protected void |
readBuffer()
Internal method which reads in the next chunk of buffered data |
| Methods inherited from class java.io.InputStream |
|---|
mark, markSupported, read, reset, skip |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected PrivateKey privateKey
protected byte[] key
protected DataInputStream stream
protected byte[] buffer
protected int bufferLength
| Constructor Detail |
|---|
public EncryptedInputStream(PrivateKey privateKey,
InputStream stream)
throws IOException
key - The keystream - The underlying stream
IOException| Method Detail |
|---|
public int read()
throws IOException
read in class InputStream-1 if the end of the
stream is reached.
IOException
public int read(byte[] b,
int off,
int len)
throws IOException
len bytes of data from the input stream into
an array of bytes. An attempt is made to read as many as
len bytes, but a smaller number may be read, possibly
zero. The number of bytes actually read is returned as an integer.
read in class InputStreamb - the buffer into which the data is read.off - the start offset in array b
at which the data is written.len - the maximum number of bytes to read.
-1 if there is no more data because the end of
the stream has been reached.
IOException
protected void readBuffer()
throws IOException
IOException
public int available()
throws IOException
available in class InputStreamIOException - if an I/O error occurs.
public void close()
throws IOException
close in interface Closeableclose in class InputStreamIOException - if an I/O error occurs.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||