@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 SeekableByteChannel
position
in class net.java.truecommons.io.DecoratingSeekableChannel
IOException
public SeekableByteChannel position(long pos) throws IOException
position
in interface SeekableByteChannel
position
in class net.java.truecommons.io.DecoratingSeekableChannel
IOException
public int read(ByteBuffer dst) throws IOException
read
in interface ReadableByteChannel
read
in interface SeekableByteChannel
read
in class net.java.truecommons.io.DecoratingSeekableChannel
IOException
Copyright © 2005–2018 Schlichtherle IT Services. All rights reserved.