![]() |
|
Contents |
The algorithm used for protection is a Vigenere (repeated-key) cipher. The encrypted data is the result of <original data>=""> XOR KEYKEYKEY...
Public Member Functions | |
| PasswordProtectedInputStream (InputStream in, byte[] password) | |
| Constructs a new instance of the receiver. | |
| int | read () throws IOException |
| Reads a single byte from this FilterInputStream and returns the result as an int. | |
| int | read (byte b[], int off, int len) throws IOException |
Reads at most length bytes from the Stream and stores them in byte array b starting at offset. | |
| long | skip (long n) throws IOException |
Skips count number of bytes in this InputStream. | |
Private Attributes | |
| byte[] | password |
| int | pwdIndex |
| PasswordProtectedInputStream | ( | InputStream | in, | |
| byte[] | password | |||
| ) |
Constructs a new instance of the receiver.
| in | The actual input stream where to read the bytes from. | |
| password | The password bytes to use to decrypt the input bytes |
| int read | ( | ) | throws IOException [virtual] |
Reads a single byte from this FilterInputStream and returns the result as an int.
The low-order byte is returned or -1 of the end of stream was encountered. This implementation returns a byte from the target stream.
| IOException | If the stream is already closed or another IOException occurs. |
Reimplemented from FilterInputStream.
| int read | ( | byte | b[], | |
| int | offset, | |||
| int | length | |||
| ) | throws IOException |
Reads at most length bytes from the Stream and stores them in byte array b starting at offset.
Answer the number of bytes actually read or -1 if no bytes were read and end of stream was encountered.
| b | the byte array in which to store the read bytes. | |
| offset | the offset in b to store the read bytes. | |
| length | the maximum number of bytes to store in b. |
| IOException | If the stream is already closed or another IOException occurs. |
Reimplemented from InputStream.
| long skip | ( | long | count | ) | throws IOException |
Skips count number of bytes in this InputStream.
Subsequent read()'s will not return these bytes unless reset() is used. This implementation skips count number of bytes in the target stream.
| count | the number of bytes to skip. |
| IOException | If the stream is already closed or another IOException occurs. |
Reimplemented from FilterInputStream.
byte [] password [private] |
int pwdIndex [private] |