Top Fields Constructors Methods
org.apache.poi.hssf.record.crypto

public final Class Biff8DecryptingStream

extends Object
implements BiffHeaderInput, LittleEndianInput
Class Inheritance
All Implemented Interfaces
org.apache.poi.util.LittleEndianInput, org.apache.poi.hssf.record.BiffHeaderInput
Imports
java.io.InputStream, .PushbackInputStream, org.apache.poi.hssf.record.*, org.apache.poi.hssf.usermodel.HSSFWorkbook, org.apache.poi.poifs.crypt.ChunkedCipherInputStream, .Decryptor, .EncryptionInfo, org.apache.poi.util.IOUtils, .Internal, .LittleEndian, .LittleEndianConsts, .LittleEndianInput, .RecordFormatException, .SuppressForbidden

Field Summary

Modifier and TypeField and Description
private final byte[]
private final ChunkedCipherInputStream
public static final int
private boolean

Constructor Summary

AccessConstructor and Description
public
Biff8DecryptingStream(InputStream in, int initialOffset, EncryptionInfo info)

Method Summary

Modifier and TypeMethod and Description
public int
public long

Returns:

the absolute position in the stream
getPosition
()

public boolean
public static boolean

Returns:

true if record type specified by sid is never encrypted
isNeverEncryptedRecord
(int sid)

Todo

Additionally, the lbPlyPos (position_of_BOF) field of the BoundSheet8 record MUST NOT be encrypted.

public byte
public int
readDataSize()

Implements org.apache.poi.hssf.record.BiffHeaderInput.readDataSize.

Reads an unsigned short value without decrypting

public double
public void
public void
readFully(byte[] buf, int off, int len)

Implements org.apache.poi.util.LittleEndianInput.readFully.

public int
public long
public void
readPlain(byte[]
the byte array to receive the bytes
b
,
int
the start offset into the byte array
off
,
int
the amount of bytes to fill
len
)

Implements org.apache.poi.util.LittleEndianInput.readPlain.

Usually acts the same as readFully(byte[], int, int), but for an encrypted stream the raw (unencrypted) data is filled

public int
readRecordSID()

Implements org.apache.poi.hssf.record.BiffHeaderInput.readRecordSID.

Reads an unsigned short value without decrypting

public short
public int
public int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bufferback to summary
private final byte[] buffer
ccisback to summary
private final ChunkedCipherInputStream ccis
RC4_REKEYING_INTERVALback to summary
public static final int RC4_REKEYING_INTERVAL
shouldSkipEncryptionOnCurrentRecordback to summary
private boolean shouldSkipEncryptionOnCurrentRecord

Constructor Detail

Biff8DecryptingStreamback to summary
public Biff8DecryptingStream(InputStream in, int initialOffset, EncryptionInfo info) throws RecordFormatException

Method Detail

availableback to summary
public int available()

Implements org.apache.poi.hssf.record.BiffHeaderInput.available, org.apache.poi.util.LittleEndianInput.available.

Returns:int

Doc from org.apache.poi.hssf.record.BiffHeaderInput.available.

the available bytes

Annotations
@Override
@SuppressForbidden:just delegating
getPositionback to summary
public long getPosition()
Returns:long

the absolute position in the stream

isCurrentRecordEncryptedback to summary
public boolean isCurrentRecordEncrypted()
Annotations
@Internal
isNeverEncryptedRecordback to summary
public static boolean isNeverEncryptedRecord(int sid)

Todo

Additionally, the lbPlyPos (position_of_BOF) field of the BoundSheet8 record MUST NOT be encrypted.

Returns:boolean

true if record type specified by sid is never encrypted

readByteback to summary
public byte readByte()

Implements org.apache.poi.util.LittleEndianInput.readByte.

Annotations
@Override
readDataSizeback to summary
public int readDataSize()

Implements org.apache.poi.hssf.record.BiffHeaderInput.readDataSize.

Reads an unsigned short value without decrypting

Returns:int

Doc from org.apache.poi.hssf.record.BiffHeaderInput.readDataSize.

the data size

Annotations
@Override
readDoubleback to summary
public double readDouble()

Implements org.apache.poi.util.LittleEndianInput.readDouble.

Annotations
@Override
readFullyback to summary
public void readFully(byte[] buf)

Implements org.apache.poi.util.LittleEndianInput.readFully.

Annotations
@Override
readFullyback to summary
public void readFully(byte[] buf, int off, int len)

Implements org.apache.poi.util.LittleEndianInput.readFully.

Annotations
@Override
readIntback to summary
public int readInt()

Implements org.apache.poi.util.LittleEndianInput.readInt.

Annotations
@Override
readLongback to summary
public long readLong()

Implements org.apache.poi.util.LittleEndianInput.readLong.

Annotations
@Override
readPlainback to summary
public void readPlain(byte[] b, int off, int len)

Implements org.apache.poi.util.LittleEndianInput.readPlain.

Doc from org.apache.poi.util.LittleEndianInput.readPlain.

Usually acts the same as readFully(byte[], int, int), but for an encrypted stream the raw (unencrypted) data is filled

Parameters
b:byte[]

the byte array to receive the bytes

off:int

the start offset into the byte array

len:int

the amount of bytes to fill

Annotations
@Override
readRecordSIDback to summary
public int readRecordSID()

Implements org.apache.poi.hssf.record.BiffHeaderInput.readRecordSID.

Reads an unsigned short value without decrypting

Returns:int

Doc from org.apache.poi.hssf.record.BiffHeaderInput.readRecordSID.

the record sid

Annotations
@Override
readShortback to summary
public short readShort()

Implements org.apache.poi.util.LittleEndianInput.readShort.

Annotations
@Override
readUByteback to summary
public int readUByte()

Implements org.apache.poi.util.LittleEndianInput.readUByte.

Annotations
@Override
readUShortback to summary
public int readUShort()

Implements org.apache.poi.util.LittleEndianInput.readUShort.

Annotations
@Override