Class PadOutputStream

java.lang.Object
  |
  +--java.io.OutputStream
        |
        +--PadOutputStream

public class PadOutputStream
extends java.io.OutputStream

PadOutputStream.java Stream that encrypts the arguments of write() with the key given as second argument, and sends the output to any OutputStream wich is the first argument (constructor)

Version:
1.0 LAST EDITED: 31.10.2000 <-little endian,
Author:
Erlend Aakre, www.klogd.net

Field Summary
 boolean debug
          Set to true to show debug info
 
Constructor Summary
PadOutputStream(java.io.OutputStream outputStream, java.io.RandomAccessFile keyFile)
          Sets the keyfile and OutputStream
 
Method Summary
 void close()
          This closes the streams
 void flush()
          This flushes the stream
 void write(int c)
          This encrypts (or decryps) the argument with the keyfile, and sends the result to outputStream
 
Methods inherited from class java.io.OutputStream
write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

public boolean debug
Set to true to show debug info
Constructor Detail

PadOutputStream

public PadOutputStream(java.io.OutputStream outputStream,
                       java.io.RandomAccessFile keyFile)
Sets the keyfile and OutputStream
Parameters:
outputStream - any outputstream to send result to
keyFile - a file to use as key
Method Detail

write

public void write(int c)
           throws java.io.IOException
This encrypts (or decryps) the argument with the keyfile, and sends the result to outputStream
Overrides:
write in class java.io.OutputStream
Parameters:
c - the data to encrypt
Throws:
java.io.IOException -  

close

public void close()
           throws java.io.IOException
This closes the streams
Overrides:
close in class java.io.OutputStream
Throws:
java.io.IOException -  

flush

public void flush()
           throws java.io.IOException
This flushes the stream
Overrides:
flush in class java.io.OutputStream
Throws:
java.io.IOException -