Package com.pnfsoftware.jeb.util.io
Class StreamWrappers
java.lang.Object
com.pnfsoftware.jeb.util.io.StreamWrappers
Convenient stream wrappers to encrypt or compress data. Currently supported: LZ4 compression, RC4
encryption.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FilterOutputStream
LZ4 compression.static FilterInputStream
getDecryptedStream
(InputStream in, byte[] key) RC4 encryption.static FilterInputStream
getDecryptedStream
(InputStream in, String algo, byte[] key) User-selectable encryption.static FilterOutputStream
getEncryptedStream
(OutputStream out, byte[] key) RC4 encryption.static FilterOutputStream
getEncryptedStream
(OutputStream out, String algo, byte[] key) User-selectable encryption.static FilterInputStream
LZ4 compression.
-
Constructor Details
-
StreamWrappers
public StreamWrappers()
-
-
Method Details
-
getCompressedStream
LZ4 compression.- Parameters:
out
-- Returns:
- an output stream performing on-write LZ4 compression
-
getUncompressedStream
LZ4 compression.- Parameters:
in
-- Returns:
- an input stream performing on-read LZ4 decompression
-
getEncryptedStream
RC4 encryption.- Parameters:
out
-key
-- Returns:
- an output stream performing on-write RC4 encryption
-
getDecryptedStream
RC4 encryption.- Parameters:
in
-key
-- Returns:
- an input stream performing on-read RC4 decryption
-
getEncryptedStream
User-selectable encryption.- Parameters:
out
-algo
-key
-- Returns:
- an output stream performing on-write encryption
-
getDecryptedStream
User-selectable encryption.- Parameters:
in
-algo
-key
-- Returns:
- an input stream performing on-read decryption
-