|
|||||||||
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 | +--sdsu.io.XorOutputStream
XorOutputStream encodes it output by Xoring all input bytes with the byte mask given in the constructor. Use a XorInputStream to decode the output of XorOutputStream by givening them both the same mask in their constructors. XorInputStream and XorOutputStream can be used for a very weak form of encryption.
Constructor Summary | |
XorOutputStream(java.io.OutputStream out,
byte mask)
|
Method Summary | |
void |
write(byte[] output,
int offset,
int length)
Writes length bytes from the specified
byte array starting at offset offset
and Xor's each byte with the streams mask. |
void |
write(int output)
Writes the specified byte and Xor's it with the
streams mask. |
Methods inherited from class java.io.FilterOutputStream |
close,
flush,
write |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public XorOutputStream(java.io.OutputStream out, byte mask)
Method Detail |
public void write(int output) throws java.io.IOException
byte
and Xor's it with the
streams mask.output
- the byte
.public void write(byte[] output, int offset, int length) throws java.io.IOException
length
bytes from the specified
byte
array starting at offset offset
and Xor's each byte with the streams mask.output
- the data.offset
- the start offset in the data.length
- the number of bytes to write.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |