Class EncryptionInputStream
-
- All Implemented Interfaces:
-
java.io.Closeable
,java.lang.AutoCloseable
public class EncryptionInputStream extends FilterInputStream
This class provides a wrapper for an InputStream that encrypts or decrypts the bytes as they are read.
-
-
Constructor Summary
Constructors Constructor Description EncryptionInputStream(InputStream in, boolean encrypt, Array<byte> encryptionKey)
-
Method Summary
Modifier and Type Method Description int
read()
int
read(@NonNull() Array<byte> b)
int
read(@NonNull() Array<byte> b, int off, int len)
long
skip(long n)
Unsupported. int
available()
void
close()
synchronized void
mark(int readlimit)
Unsupported. synchronized void
reset()
Unsupported. boolean
markSupported()
-
-
Constructor Detail
-
EncryptionInputStream
EncryptionInputStream(InputStream in, boolean encrypt, Array<byte> encryptionKey)
- Parameters:
in
- The InputStream that will be encrypted/decrypted.encrypt
- True means the InputStream will be encrypted.encryptionKey
- The key which is used for encryption/decryption.
-
-
Method Detail
-
read
int read()
-
read
int read(@NonNull() Array<byte> b)
-
read
int read(@NonNull() Array<byte> b, int off, int len)
-
skip
long skip(long n)
Unsupported. This method will throw an UnsupportedOperationException.
- Parameters:
n
- ignored
-
available
int available()
-
close
void close()
-
mark
synchronized void mark(int readlimit)
Unsupported. This method will throw an UnsupportedOperationException.
- Parameters:
readlimit
- ignored
-
reset
synchronized void reset()
Unsupported. This method will throw an UnsupportedOperationException.
-
markSupported
boolean markSupported()
-
-
-
-