WDYSEncrypt
Class WDYSDecryptedFileReader

java.lang.Object
  extended byWDYSEncrypt.WDYSDecryptedFileReader

public class WDYSDecryptedFileReader
extends Object

This class reads decrypted WDYS files 4 bytes at a time.

Version:
1
Author:
Berend "Kirk" Wouda

Field Summary
protected  File decryptedfile
          The file.
protected  BufferedInputStream reader
          The reader.
 
Constructor Summary
WDYSDecryptedFileReader(String filename)
          Constructs a new file reader around the given file.
 
Method Summary
 void close()
          Closes the file.
 long getDecryptedDataLength()
          Returns the length of the decrypted file.
 byte[] read4DecryptedDataBytes()
          Reads and returns the next 4 bytes from the decrypted data file.
 byte[] readDecryptedDataBytes(int amount)
          Reads and returns the next given amount of bytes from the decrypted data file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

decryptedfile

protected File decryptedfile
The file.


reader

protected BufferedInputStream reader
The reader. Well it's a stream actually.

Constructor Detail

WDYSDecryptedFileReader

public WDYSDecryptedFileReader(String filename)
                        throws IOException
Constructs a new file reader around the given file.

Parameters:
filename - The name of the decrypted file.
Throws:
IOException - When IO stuff goes wrong.
Method Detail

close

public void close()
           throws IOException
Closes the file.

Throws:
IOException - When IO stuff goes wrong.

getDecryptedDataLength

public long getDecryptedDataLength()
Returns the length of the decrypted file.

Returns:
Said length.

read4DecryptedDataBytes

public byte[] read4DecryptedDataBytes()
                               throws IOException,
                                      WDYSEncryptException
Reads and returns the next 4 bytes from the decrypted data file.

Returns:
What I just said above, jeez.
Throws:
IOException - When IO stuff goes wrong.
WDYSEncryptException - When the 4 bytes could not be supplied.

readDecryptedDataBytes

public byte[] readDecryptedDataBytes(int amount)
                              throws IOException,
                                     WDYSEncryptException
Reads and returns the next given amount of bytes from the decrypted data file.

Parameters:
amount - The amount of bytes to be read.
Returns:
What I just said above, jeez.
Throws:
IOException - When IO stuff goes wrong.
WDYSEncryptException - When the given amount of bytes could not be supplied.