Package io
Class EncodingOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- io.EncodingOutputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
public class EncodingOutputStream extends java.io.FilterOutputStreamOutput stream with simple encoding capability. Each byte is xor'ed with secret key.- Author:
- Georgiy Korneev
-
-
Field Summary
Fields Modifier and Type Field Description private intkeySecret key.
-
Constructor Summary
Constructors Constructor Description EncodingOutputStream(java.io.OutputStream os, int key)Creates a newEncodingOutputStream.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidmain(java.lang.String[] args)Encodes a file specified by the first argument by key 'a' and writes result to the file specified by the second argument.voidwrite(int b)
-
-
-
Method Detail
-
write
public void write(int b) throws java.io.IOException- Overrides:
writein classjava.io.FilterOutputStream- Throws:
java.io.IOException
-
main
public static void main(java.lang.String[] args)
Encodes a file specified by the first argument by key 'a' and writes result to the file specified by the second argument.- Parameters:
args- command line arguments.
-
-