Class Biff8DecryptingStream
java.lang.Object
org.apache.poi.hssf.record.crypto.Biff8DecryptingStream
- All Implemented Interfaces:
BiffHeaderInput,LittleEndianInput
public final class Biff8DecryptingStream
extends Object
implements BiffHeaderInput, LittleEndianInput
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBiff8DecryptingStream(InputStream in, int initialOffset, EncryptionInfo info) -
Method Summary
Modifier and TypeMethodDescriptionintlongstatic booleanisNeverEncryptedRecord(int sid) TODO: Additionally, the lbPlyPos (position_of_BOF) field of the BoundSheet8 record MUST NOT be encrypted.bytereadByte()intReads an unsigned short value without decryptingdoublevoidreadFully(byte[] buf) voidreadFully(byte[] buf, int off, int len) intreadInt()longreadLong()voidreadPlain(byte[] b, int off, int len) Usually acts the same asLittleEndianInput.readFully(byte[], int, int), but for an encrypted stream the raw (unencrypted) data is filledintReads an unsigned short value without decryptingshortintint
-
Field Details
-
RC4_REKEYING_INTERVAL
public static final int RC4_REKEYING_INTERVAL- See Also:
-
-
Constructor Details
-
Biff8DecryptingStream
public Biff8DecryptingStream(InputStream in, int initialOffset, EncryptionInfo info) throws RecordFormatException - Throws:
RecordFormatException
-
-
Method Details
-
available
public int available()- Specified by:
availablein interfaceBiffHeaderInput- Specified by:
availablein interfaceLittleEndianInput- Returns:
- the available bytes
-
readRecordSID
public int readRecordSID()Reads an unsigned short value without decrypting- Specified by:
readRecordSIDin interfaceBiffHeaderInput- Returns:
- the record sid
-
readDataSize
public int readDataSize()Reads an unsigned short value without decrypting- Specified by:
readDataSizein interfaceBiffHeaderInput- Returns:
- the data size
-
readDouble
public double readDouble()- Specified by:
readDoublein interfaceLittleEndianInput
-
readFully
public void readFully(byte[] buf) - Specified by:
readFullyin interfaceLittleEndianInput
-
readFully
public void readFully(byte[] buf, int off, int len) - Specified by:
readFullyin interfaceLittleEndianInput
-
readUByte
public int readUByte()- Specified by:
readUBytein interfaceLittleEndianInput
-
readByte
public byte readByte()- Specified by:
readBytein interfaceLittleEndianInput
-
readUShort
public int readUShort()- Specified by:
readUShortin interfaceLittleEndianInput
-
readShort
public short readShort()- Specified by:
readShortin interfaceLittleEndianInput
-
readInt
public int readInt()- Specified by:
readIntin interfaceLittleEndianInput
-
readLong
public long readLong()- Specified by:
readLongin interfaceLittleEndianInput
-
getPosition
public long getPosition()- Returns:
- the absolute position in the stream
-
isNeverEncryptedRecord
public static boolean isNeverEncryptedRecord(int sid) TODO: Additionally, the lbPlyPos (position_of_BOF) field of the BoundSheet8 record MUST NOT be encrypted.- Returns:
trueif record type specified by sid is never encrypted
-
readPlain
public void readPlain(byte[] b, int off, int len) Description copied from interface:LittleEndianInputUsually acts the same asLittleEndianInput.readFully(byte[], int, int), but for an encrypted stream the raw (unencrypted) data is filled- Specified by:
readPlainin interfaceLittleEndianInput- Parameters:
b- the byte array to receive the bytesoff- the start offset into the byte arraylen- the amount of bytes to fill
-