org.apache.poi.hssf.record.cont
Class ContinuableRecordInput
- java.lang.Object
-
- org.apache.poi.hssf.record.cont.ContinuableRecordInput
-
- All Implemented Interfaces:
- LittleEndianInput
public class ContinuableRecordInput extends java.lang.Object implements LittleEndianInput
A decoratedRecordInputStreamthat can read primitive data types (short, int, long, etc.) spanned across aContinueRecordboundary.Most records construct themselves from
Two attachments to Bugzilla 50779 demonstrate that a CONTINUE break can appear right in between two bytes of a unicode character or between two bytes of aRecordInputStream. This class assumes that aContinueRecordrecord 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.RecordInputStreamgreedily requests the bytes to be read and stumbles on such files with a "Not enough data (1) to read requested (2) bytes" exception. TheContinuableRecordInputclass 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
-
-
Constructor Summary
Constructors Constructor and Description ContinuableRecordInput(RecordInputStream in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intavailable()bytereadByte()doublereadDouble()voidreadFully(byte[] buf)voidreadFully(byte[] buf, int off, int len)intreadInt()longreadLong()shortreadShort()intreadUByte()intreadUShort()
-
-
-
Constructor Detail
-
ContinuableRecordInput
public ContinuableRecordInput(RecordInputStream in)
-
-
Method Detail
-
available
public int available()
- Specified by:
availablein interfaceLittleEndianInput
-
readByte
public byte readByte()
- Specified by:
readBytein interfaceLittleEndianInput
-
readUByte
public int readUByte()
- Specified by:
readUBytein interfaceLittleEndianInput
-
readShort
public short readShort()
- Specified by:
readShortin interfaceLittleEndianInput
-
readUShort
public int readUShort()
- Specified by:
readUShortin interfaceLittleEndianInput
-
readInt
public int readInt()
- Specified by:
readIntin interfaceLittleEndianInput
-
readLong
public long readLong()
- Specified by:
readLongin interfaceLittleEndianInput
-
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
-
-
DataMelt 3.0 © DataMelt by jWork.ORG