|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.io.OutputStream
|
+--java.io.FilterOutputStream
|
+--javax.crypto.CipherOutputStream
Class for en/decrypting data to be written to an output stream.
Attention: This is not a SUN implementation!
This class has been developed by IAIK according to the documentation publically available.
For SUNīs documentation of this class see
http://java.sun.com/security/JCE1.2/spec/apidoc/index.html
This class extends the java.io.FilterOutputStream class for combining the functionality
of a OutputStream and a Cipher.
According to the operation mode the Cipher has been initialized with, data is
en/decrypted before writing it to the underlying stream when calling one of the
write() methods.
An application may use this class for encrypting and writing data to a file.
OutputStream,
FilterOutputStream,
Cipher,
CipherInputStream| Fields inherited from class java.io.FilterOutputStream |
out |
| Constructor Summary | |
CipherOutputStream(java.io.OutputStream os)
Creates a CipherOutputStream only from an OutputStream. |
|
CipherOutputStream(java.io.OutputStream os,
Cipher cipher)
Creates a CipherOutputStream using an OutputStream and a Cipher initialized either for encryption or decryption. |
|
| Method Summary | |
void |
close()
Calls the cipher for the last time and closes the output stream. |
void |
write(byte[] b)
Writes the bytes from the given byte array to this output stream. |
void |
write(byte[] b,
int off,
int len)
Writes a specified number of bytes from a given position of the given byte array to this output stream. |
void |
write(int b)
Writes a byte to the underlying output stream. |
| Methods inherited from class java.io.FilterOutputStream |
flush |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public CipherOutputStream(java.io.OutputStream os,
Cipher cipher)
os - the output stream.cipher - an initialized cipher.public CipherOutputStream(java.io.OutputStream os)
os - the output stream| Method Detail |
public void write(int b)
throws java.io.IOException
b - the byte to be written to this stream
public void write(byte[] b)
throws java.io.IOException
b - the byte array containing the data to be written to this stream
public void write(byte[] b,
int off,
int len)
throws java.io.IOException
b - the byte array containing the data to be written to this streamoff - the start offset indicating the position within the given byte array b
from which the data is to be taken for en/decrypting and writing it to the streamlen - the number of bytes to write this stream
public void close()
throws java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||