WDYSDecrypt
Class WDYSDecryptedFileWriter

java.lang.Object
  extended byWDYSDecrypt.WDYSDecryptedFileWriter

public class WDYSDecryptedFileWriter
extends Object

This class writes decrypted WDYS files.

Version:
1
Author:
Berend "Kirk" Wouda

Field Summary
protected  long length
          The length of the decrypted data chunk (stored seperately in the file).
protected  BufferedOutputStream writer
          The writer.
protected  long written
          The amount of bytes written.
 
Constructor Summary
WDYSDecryptedFileWriter(String filename, long length)
          Constructs a new file writer around the given file, with the given length.
 
Method Summary
 void close()
          Closes the file.
 void write8DecryptedDataBytes(byte[] octet)
          Writes the next 8 bytes to the file, until the length is reached.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

length

protected long length
The length of the decrypted data chunk (stored seperately in the file).


written

protected long written
The amount of bytes written.


writer

protected BufferedOutputStream writer
The writer. Well it's a stream actually.

Constructor Detail

WDYSDecryptedFileWriter

public WDYSDecryptedFileWriter(String filename,
                               long length)
                        throws IOException
Constructs a new file writer around the given file, with the given length. The file will be cut off at the given length, and any more calls to write cause exceptions. This is to ensure that the padding data to make the decrypted file an multiple of 8 bytes, is not written to the file.

Parameters:
filename - The name of the encrypted file.
length - The length this file will be.
Method Detail

close

public void close()
           throws IOException
Closes the file.

Throws:
IOException - When IO stuff goes wrong.

write8DecryptedDataBytes

public void write8DecryptedDataBytes(byte[] octet)
                              throws IOException,
                                     WDYSDecryptException
Writes the next 8 bytes to the file, until the length is reached.

Parameters:
octet - The next 8 bytes to be written.
Throws:
IOException - When IO stuff goes wrong.
WDYSDecryptException - When the indicated length is exceeded.