public class PositionedCryptoInputStream extends CtrCryptoInputStream
EOS, STREAM_BUFFER_SIZE_KEY| Modifier | Constructor and Description |
|---|---|
|
PositionedCryptoInputStream(Properties properties,
Input in,
byte[] key,
byte[] iv,
long streamOffset)
Constructs a
PositionedCryptoInputStream. |
protected |
PositionedCryptoInputStream(Properties properties,
Input input,
CryptoCipher cipher,
int bufferSize,
byte[] key,
byte[] iv,
long streamOffset)
Constructs a
PositionedCryptoInputStream. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Overrides the
CryptoInputStream.close(). |
protected void |
decrypt(long position,
byte[] buffer,
int offset,
int length)
Decrypts length bytes in buffer starting at offset.
|
int |
read(long position,
byte[] buffer,
int offset,
int length)
Reads up to the specified number of bytes from a given position within a
stream and return the number of bytes read.
|
void |
readFully(long position,
byte[] buffer)
Reads the specified number of bytes from a given position within a
stream.
|
void |
readFully(long position,
byte[] buffer,
int offset,
int length)
Reads the specified number of bytes from a given position within a
stream.
|
decrypt, decrypt, decryptBuffer, decryptInPlace, decryptMore, getCounter, getInitIV, getPadding, getStreamOffset, getStreamPosition, initCipher, postDecryption, read, resetCipher, resetStreamOffset, seek, setStreamOffset, skipavailable, checkStream, decryptFinal, freeBuffers, getBufferSize, getCipher, getInput, getKey, getParams, isOpen, markSupported, read, readmark, read, resetpublic PositionedCryptoInputStream(Properties properties, Input in, byte[] key, byte[] iv, long streamOffset) throws IOException
PositionedCryptoInputStream.properties - The Properties class represents a set of
properties.in - the input data.key - crypto key for the cipher.iv - Initialization vector for the cipher.streamOffset - the start offset in the data.IOException - if an I/O error occurs.protected PositionedCryptoInputStream(Properties properties, Input input, CryptoCipher cipher, int bufferSize, byte[] key, byte[] iv, long streamOffset) throws IOException
PositionedCryptoInputStream.properties - the properties of streaminput - the input data.cipher - the CryptoCipher instance.bufferSize - the bufferSize.key - crypto key for the cipher.iv - Initialization vector for the cipher.streamOffset - the start offset in the data.IOException - if an I/O error occurs.public void close() throws IOException
CryptoInputStream.close(). Closes this input stream
and releases any system resources associated with the stream.close in interface Closeableclose in interface AutoCloseableclose in interface Channelclose in class CryptoInputStreamIOException - if an I/O error occurs.protected void decrypt(long position, byte[] buffer, int offset, int length) throws IOException
buffer - the buffer into which the data is read.offset - the start offset in the data.position - the offset from the start of the stream.length - the maximum number of bytes to read.IOException - if an I/O error occurs.public int read(long position, byte[] buffer, int offset, int length) throws IOException
buffer - the buffer into which the data is read.length - the maximum number of bytes to read.offset - the start offset in the data.position - the offset from the start of the stream.IOException - if an I/O error occurs.public void readFully(long position, byte[] buffer) throws IOException
position - the offset from the start of the stream.buffer - the buffer into which the data is read.IOException - if an I/O error occurs.public void readFully(long position, byte[] buffer, int offset, int length) throws IOException
buffer - the buffer into which the data is read.length - the maximum number of bytes to read.offset - the start offset in the data.position - the offset from the start of the stream.IOException - if an I/O error occurs.Copyright © 2016–2022 The Apache Software Foundation. All rights reserved.