@Internal public abstract class ChunkedCipherInputStream extends LittleEndianInputStream
| Constructor and Description |
|---|
ChunkedCipherInputStream(java.io.InputStream stream,
long size,
int chunkSize) |
ChunkedCipherInputStream(java.io.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 javax.crypto.Cipher |
initCipherForBlock(javax.crypto.Cipher existing,
int block) |
javax.crypto.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, skipFullypublic ChunkedCipherInputStream(java.io.InputStream stream,
long size,
int chunkSize)
throws java.security.GeneralSecurityException
java.security.GeneralSecurityExceptionpublic ChunkedCipherInputStream(java.io.InputStream stream,
long size,
int chunkSize,
int initialPos)
throws java.security.GeneralSecurityException
java.security.GeneralSecurityExceptionpublic final javax.crypto.Cipher initCipherForBlock(int block)
throws java.io.IOException,
java.security.GeneralSecurityException
java.io.IOExceptionjava.security.GeneralSecurityExceptionprotected abstract javax.crypto.Cipher initCipherForBlock(javax.crypto.Cipher existing,
int block)
throws java.security.GeneralSecurityException
java.security.GeneralSecurityExceptionpublic int read()
throws java.io.IOException
read in class java.io.FilterInputStreamjava.io.IOExceptionpublic int read(byte[] b,
int off,
int len)
throws java.io.IOException
read in class LittleEndianInputStreamjava.io.IOExceptionpublic long skip(long n)
skip in class java.io.FilterInputStreampublic int available()
available in interface LittleEndianInputavailable in class LittleEndianInputStreampublic boolean markSupported()
markSupported in class java.io.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 java.security.GeneralSecurityException
java.security.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()
Copyright 2022 The Apache Software Foundation or its licensors, as applicable.