Package org.cryptomator.cryptolib.common
Class EncryptingReadableByteChannel
- java.lang.Object
-
- org.cryptomator.cryptolib.common.EncryptingReadableByteChannel
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Channel
,ReadableByteChannel
public class EncryptingReadableByteChannel extends Object implements ReadableByteChannel
-
-
Constructor Summary
Constructors Constructor Description EncryptingReadableByteChannel(ReadableByteChannel src, Cryptor cryptor)
Creates an EncryptingReadableByteChannel that encrypts a whole cleartext file beginning at its first byte.
-
-
-
Constructor Detail
-
EncryptingReadableByteChannel
public EncryptingReadableByteChannel(ReadableByteChannel src, Cryptor cryptor)
Creates an EncryptingReadableByteChannel that encrypts a whole cleartext file beginning at its first byte.- Parameters:
src
- A cleartext channel positioned at its begincryptor
- The cryptor to use
-
-
Method Detail
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceChannel
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
read
public int read(ByteBuffer dst) throws IOException
- Specified by:
read
in interfaceReadableByteChannel
- Throws:
IOException
-
-