Package org.apache.poi.hssf.record.cont
Class ContinuableRecordInput
java.lang.Object
org.apache.poi.hssf.record.cont.ContinuableRecordInput
- All Implemented Interfaces:
LittleEndianInput
A decorated
RecordInputStream
that can read primitive data types
(short, int, long, etc.) spanned across a ContinueRecord
boundary.
Most records construct themselves from RecordInputStream
.
This class assumes that a ContinueRecord
record break always occurs at the type boundary,
however, it is not always so.
short
. The problematic portion of the data is
in a Asian Phonetic Settings Block (ExtRst) of a UnicodeString.
RecordInputStream
greedily requests the bytes to be read and stumbles on such files with a
"Not enough data (1) to read requested (2) bytes" exception. The ContinuableRecordInput
class circumvents this "type boundary" rule and reads data byte-by-byte rolling over CONTINUE if necessary.
YK: For now (March 2011) this class is only used to read
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
byte
readByte()
double
void
readFully
(byte[] buf) void
readFully
(byte[] buf, int off, int len) int
readInt()
long
readLong()
void
readPlain
(byte[] buf, int off, int len) Usually acts the same asLittleEndianInput.readFully(byte[], int, int)
, but for an encrypted stream the raw (unencrypted) data is filledshort
int
int
-
Constructor Details
-
ContinuableRecordInput
-
-
Method Details
-
available
public int available()- Specified by:
available
in interfaceLittleEndianInput
-
readByte
public byte readByte()- Specified by:
readByte
in interfaceLittleEndianInput
-
readUByte
public int readUByte()- Specified by:
readUByte
in interfaceLittleEndianInput
-
readShort
public short readShort()- Specified by:
readShort
in interfaceLittleEndianInput
-
readUShort
public int readUShort()- Specified by:
readUShort
in interfaceLittleEndianInput
-
readInt
public int readInt()- Specified by:
readInt
in interfaceLittleEndianInput
-
readLong
public long readLong()- Specified by:
readLong
in interfaceLittleEndianInput
-
readDouble
public double readDouble()- Specified by:
readDouble
in interfaceLittleEndianInput
-
readFully
public void readFully(byte[] buf) - Specified by:
readFully
in interfaceLittleEndianInput
-
readFully
public void readFully(byte[] buf, int off, int len) - Specified by:
readFully
in interfaceLittleEndianInput
-
readPlain
public void readPlain(byte[] buf, int off, int len) Description copied from interface:LittleEndianInput
Usually acts the same asLittleEndianInput.readFully(byte[], int, int)
, but for an encrypted stream the raw (unencrypted) data is filled- Specified by:
readPlain
in interfaceLittleEndianInput
- Parameters:
buf
- the byte array to receive the bytesoff
- the start offset into the byte arraylen
- the amount of bytes to fill
-