@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.
(在读取 BIFF 标头字段(sid、size)时使用。)
|
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, skipFully
public ChunkedCipherInputStream(java.io.InputStream stream, long size, int chunkSize) throws java.security.GeneralSecurityException
java.security.GeneralSecurityException
(java.security.GeneralSecurityException)
public ChunkedCipherInputStream(java.io.InputStream stream, long size, int chunkSize, int initialPos) throws java.security.GeneralSecurityException
java.security.GeneralSecurityException
(java.security.GeneralSecurityException)
public final javax.crypto.Cipher initCipherForBlock(int block) throws java.io.IOException, java.security.GeneralSecurityException
java.io.IOException
(java.io.IOException)
java.security.GeneralSecurityException
(java.security.GeneralSecurityException)
protected abstract javax.crypto.Cipher initCipherForBlock(javax.crypto.Cipher existing, int block) throws java.security.GeneralSecurityException
java.security.GeneralSecurityException
(java.security.GeneralSecurityException)
public int read() throws java.io.IOException
read
in class
java.io.FilterInputStream
java.io.IOException
(java.io.IOException)
public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class
LittleEndianInputStream
java.io.IOException
(java.io.IOException)
public long skip(long n)
skip
in class
java.io.FilterInputStream
public int available()
available
in interface
LittleEndianInput
(在接口 LittleEndianInput 中可用)
available
in class
LittleEndianInputStream
public boolean markSupported()
markSupported
in class
java.io.FilterInputStream
public void mark(int readlimit)
mark
in class
LittleEndianInputStream
public void reset()
reset
in class
LittleEndianInputStream
protected int getChunkMask()
protected int invokeCipher(int totalBytes, boolean doFinal) throws java.security.GeneralSecurityException
java.security.GeneralSecurityException
(java.security.GeneralSecurityException)
public void readPlain(byte[] b, int off, int len)
Cipher
instance must step even when unencrypted bytes are read
(在读取 BIFF 标头字段(sid、size)时使用。即使读取未加密的字节,内部 Cipher 实例也必须执行)
readPlain
in interface
LittleEndianInput
(接口 LittleEndianInput 中的 readPlain)
readPlain
in class
LittleEndianInputStream
b
- the byte array to receive the bytes
(b - 接收字节的字节数组)
off
- the start offset into the byte array
(off - 字节数组的起始偏移量)
len
- the amount of bytes to fill
(len - 要填充的字节数)
public void setNextRecordSize(int recordSize)
recordSize
- the size of the next record
(recordSize - 下一条记录的大小)
protected byte[] getChunk()
protected byte[] getPlain()
public long getPos()
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.