|
ePOST API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.InputStream rice.p2p.util.EncryptedInputStream
public class EncryptedInputStream
Field Summary | |
---|---|
protected byte[] |
buffer
|
protected int |
bufferLength
|
protected byte[] |
key
|
protected java.security.PrivateKey |
privateKey
|
protected java.io.DataInputStream |
stream
|
Constructor Summary | |
---|---|
EncryptedInputStream(java.security.PrivateKey privateKey,
java.io.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 java.security.PrivateKey privateKey
protected byte[] key
protected java.io.DataInputStream stream
protected byte[] buffer
protected int bufferLength
Constructor Detail |
---|
public EncryptedInputStream(java.security.PrivateKey privateKey, java.io.InputStream stream) throws java.io.IOException
key
- The keystream
- The underlying stream
java.io.IOException
Method Detail |
---|
public int read() throws java.io.IOException
read
in class java.io.InputStream
-1
if the end of the
stream is reached.
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.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 java.io.InputStream
b
- 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.
java.io.IOException
protected void readBuffer() throws java.io.IOException
java.io.IOException
public int available() throws java.io.IOException
available
in class java.io.InputStream
java.io.IOException
- if an I/O error occurs.public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.InputStream
java.io.IOException
- if an I/O error occurs.
|
ePOST API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |