@NotThreadSafe
public final class CipherReadOnlyChannel
extends net.java.truecommons.io.ReadOnlyChannel
CipherOutputStream| Constructor and Description |
|---|
CipherReadOnlyChannel(SeekableBlockCipher cipher,
java.nio.channels.SeekableByteChannel channel)
Constructs a new cipher read-only channel.
|
CipherReadOnlyChannel(SeekableBlockCipher cipher,
java.nio.channels.SeekableByteChannel channel,
int bufferSize)
Constructs a new cipher read-only channel.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
mac(org.bouncycastle.crypto.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() |
java.nio.channels.SeekableByteChannel |
position(long pos) |
int |
read(java.nio.ByteBuffer dst) |
@CreatesObligation public CipherReadOnlyChannel(SeekableBlockCipher cipher, @WillCloseWhenClosed java.nio.channels.SeekableByteChannel channel)
cipher - the initialized, seekable block cipher.channel - the seekable byte channel.@CreatesObligation public CipherReadOnlyChannel(SeekableBlockCipher cipher, @WillCloseWhenClosed java.nio.channels.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(org.bouncycastle.crypto.Mac mac)
throws java.io.IOException
mac - a properly initialized MAC object.java.io.IOException - on any I/O error.public int read(java.nio.ByteBuffer dst)
throws java.io.IOException
read in interface java.nio.channels.ReadableByteChannelread in interface java.nio.channels.SeekableByteChannelread in class net.java.truecommons.io.DecoratingSeekableChanneljava.io.IOExceptionpublic long position()
throws java.io.IOException
position in interface java.nio.channels.SeekableByteChannelposition in class net.java.truecommons.io.DecoratingSeekableChanneljava.io.IOExceptionpublic java.nio.channels.SeekableByteChannel position(long pos)
throws java.io.IOException
position in interface java.nio.channels.SeekableByteChannelposition in class net.java.truecommons.io.DecoratingSeekableChanneljava.io.IOException