|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.OutputStream rice.p2p.util.EncryptedOutputStream
public class EncryptedOutputStream
Field Summary | |
---|---|
protected byte[] |
buffer
|
int |
BUFFER_SIZE
|
protected int |
bufferLength
|
protected byte[] |
key
|
protected java.security.PublicKey |
publicKey
|
protected java.io.DataOutputStream |
stream
|
Constructor Summary | |
---|---|
EncryptedOutputStream(java.security.PublicKey publicKey,
java.io.OutputStream stream,
int bufferSize)
Builds an encrypted outputstream given a public key to encrypt thing under |
Method Summary | |
---|---|
void |
close()
Closes this output stream and releases any system resources associated with this stream. |
void |
flush()
Flushes this output stream and forces any buffered output bytes to be written out. |
void |
write(byte[] b,
int off,
int len)
Writes the given bytes to the output |
void |
write(int b)
Writes the specified byte to this output stream. |
protected void |
writeBuffer()
Internal method which writes out the buffered data |
Methods inherited from class java.io.OutputStream |
---|
write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final int BUFFER_SIZE
protected java.security.PublicKey publicKey
protected byte[] key
protected java.io.DataOutputStream stream
protected byte[] buffer
protected int bufferLength
Constructor Detail |
---|
public EncryptedOutputStream(java.security.PublicKey publicKey, java.io.OutputStream stream, int bufferSize) throws java.io.IOException
key
- The keystream
- The underlying stream
java.io.IOException
Method Detail |
---|
public void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
b
- the byte
java.io.IOException
public void write(byte[] b, int off, int len) throws java.io.IOException
write
in class java.io.OutputStream
b
- the data.off
- the start offset in the data.len
- the number of bytes to write.
java.io.IOException
protected void writeBuffer() throws java.io.IOException
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.OutputStream
java.io.IOException
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |