@Internal public abstract class ChunkedCipherInputStream extends LittleEndianInputStream
in| Constructor and Description |
|---|
ChunkedCipherInputStream(InputStream stream,
long size,
int chunkSize) |
ChunkedCipherInputStream(InputStream stream,
long size,
int chunkSize,
int initialPos) |
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
protected byte[] |
getChunk() |
protected int |
getChunkMask() |
protected byte[] |
getPlain() |
long |
getPos() |
protected abstract Cipher |
initCipherForBlock(Cipher existing,
int block) |
Cipher |
initCipherForBlock(int block) |
protected int |
invokeCipher(int totalBytes,
boolean doFinal)
Helper function for overriding the cipher invocation, i.e.
|
void |
mark(int readlimit) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
void |
readPlain(byte[] b,
int off,
int len)
Used when BIFF header fields (sid, size) are being read.
|
void |
reset() |
void |
setNextRecordSize(int recordSize)
Some ciphers (actually just XOR) are based on the record size,
which needs to be set before decryption
|
long |
skip(long n) |
getReadIndex, readByte, readDouble, readFloat, readFully, readFully, readInt, readLong, readShort, readUByte, readUInt, readUShort, skipFullyclose, readpublic ChunkedCipherInputStream(InputStream stream, long size, int chunkSize) throws GeneralSecurityException
GeneralSecurityExceptionpublic ChunkedCipherInputStream(InputStream stream, long size, int chunkSize, int initialPos) throws GeneralSecurityException
GeneralSecurityExceptionpublic final Cipher initCipherForBlock(int block) throws IOException, GeneralSecurityException
IOExceptionGeneralSecurityExceptionprotected abstract Cipher initCipherForBlock(Cipher existing, int block) throws GeneralSecurityException
GeneralSecurityExceptionpublic int read()
throws IOException
read in class FilterInputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in class LittleEndianInputStreamIOExceptionpublic long skip(long n)
skip in class FilterInputStreampublic int available()
available in interface LittleEndianInputavailable in class LittleEndianInputStreampublic boolean markSupported()
markSupported in class FilterInputStreampublic void mark(int readlimit)
mark in class LittleEndianInputStreampublic void reset()
reset in class LittleEndianInputStreamprotected int getChunkMask()
protected int invokeCipher(int totalBytes,
boolean doFinal)
throws GeneralSecurityException
GeneralSecurityExceptionpublic void readPlain(byte[] b,
int off,
int len)
Cipher instance must step even when unencrypted bytes are readreadPlain in interface LittleEndianInputreadPlain in class LittleEndianInputStreamb - the byte array to receive the bytesoff - the start offset into the byte arraylen - the amount of bytes to fillpublic void setNextRecordSize(int recordSize)
recordSize - the size of the next recordprotected byte[] getChunk()
protected byte[] getPlain()
public long getPos()