public class PositionedCryptoInputStream extends CtrCryptoInputStream
STREAM_BUFFER_SIZE_KEY| ??? | ?????? |
|---|---|
|
PositionedCryptoInputStream(Properties props,
Input in,
byte[] key,
byte[] iv,
long streamOffset)
Constructs a
PositionedCryptoInputStream. |
protected |
PositionedCryptoInputStream(Properties props,
Input input,
CryptoCipher cipher,
int bufferSize,
byte[] key,
byte[] iv,
long streamOffset)
Constructs a
PositionedCryptoInputStream. |
| ?????? | ????? |
|---|---|
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, mark, markSupported, read, read, resetreadpublic PositionedCryptoInputStream(Properties props, Input in, byte[] key, byte[] iv, long streamOffset) throws IOException
PositionedCryptoInputStream.props - 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 props, Input input, CryptoCipher cipher, int bufferSize, byte[] key, byte[] iv, long streamOffset) throws IOException
PositionedCryptoInputStream.props - the props 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 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,
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.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 void close()
throws IOException
CryptoInputStream.close(). Closes this input stream
and releases any system resources associated with the stream.close ???? Closeableclose ???? AutoCloseableclose ???? Channelclose ??? CryptoInputStreamIOException - if an I/O error occurs.Copyright © 2016 The Apache Software Foundation. All rights reserved.