@NotThreadSafe public final class CipherReadOnlyChannel extends net.java.truecommons.io.ReadOnlyChannel
CipherOutputStream| Constructor and Description |
|---|
CipherReadOnlyChannel(SeekableBlockCipher cipher,
SeekableByteChannel channel)
Constructs a new cipher read-only channel.
|
CipherReadOnlyChannel(SeekableBlockCipher cipher,
SeekableByteChannel channel,
int bufferSize)
Constructs a new cipher read-only channel.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
mac(Mac mac)
Returns the authentication code of the encrypted data in this cipher
read-only channel using the given Message Authentication Code (MAC)
object.
|
long |
position() |
SeekableByteChannel |
position(long pos) |
int |
read(ByteBuffer dst) |
@CreatesObligation public CipherReadOnlyChannel(SeekableBlockCipher cipher, @WillCloseWhenClosed SeekableByteChannel channel)
cipher - the initialized, seekable block cipher.channel - the seekable byte channel.@CreatesObligation public CipherReadOnlyChannel(SeekableBlockCipher cipher, @WillCloseWhenClosed SeekableByteChannel channel, int bufferSize)
cipher - the seekable block cipher.channel - the seekable byte channel.bufferSize - the size of the byte buffer.
The value gets rounded down to a multiple of the cipher's
blocksize or the cipher's blocksize, whatever is larger.public byte[] mac(Mac mac) throws IOException
mac - a properly initialized MAC object.IOException - on any I/O error.public long position()
throws IOException
position in interface SeekableByteChannelposition in class net.java.truecommons.io.DecoratingSeekableChannelIOExceptionpublic SeekableByteChannel position(long pos) throws IOException
position in interface SeekableByteChannelposition in class net.java.truecommons.io.DecoratingSeekableChannelIOExceptionpublic int read(ByteBuffer dst) throws IOException
read in interface ReadableByteChannelread in interface SeekableByteChannelread in class net.java.truecommons.io.DecoratingSeekableChannelIOExceptionCopyright © 2005–2018 Schlichtherle IT Services. All rights reserved.