|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.InputStream org.apache.poi.hssf.record.RecordInputStream
public class RecordInputStream
Title: Record Input Stream
Description: Wraps a stream and provides helper methods for the construction of records.
Field Summary | |
---|---|
protected short |
currentLength
|
protected short |
currentSid
|
protected byte[] |
data
|
static short |
MAX_RECORD_DATA_SIZE
Maximum size of a single record (minus the 4 byte header) without a continue |
protected short |
nextSid
|
protected long |
pos
|
protected short |
recordOffset
|
Constructor Summary | |
---|---|
RecordInputStream(java.io.InputStream in)
|
Method Summary | |
---|---|
protected void |
checkRecordPosition()
|
boolean |
getAutoContinue()
|
short |
getLength()
|
byte[] |
getNANData()
|
long |
getPos()
|
short |
getRecordOffset()
|
short |
getSid()
|
boolean |
hasNextRecord()
|
boolean |
isContinueNext()
Returns true iif a Continue record is next in the excel stream |
void |
nextRecord()
Moves to the next record in the stream. |
int |
read()
This method will read a byte from the current record |
byte[] |
readAllContinuedRemainder()
Deprecated. Best to write a input stream that wraps this one where there is special sub record that may overlap continue records. |
byte |
readByte()
Reads an 8 bit, signed value |
java.lang.String |
readCompressedUnicode(int length)
|
double |
readDouble()
|
int |
readInt()
|
long |
readLong()
|
byte[] |
readRemainder()
Returns the remaining bytes for the current record. |
short |
readShort()
Reads a 16 bit, signed value |
short[] |
readShortArray()
|
short |
readUByte()
Reads an 8 bit, unsigned value |
java.lang.String |
readUnicodeLEString(int length)
given a byte array of 16-bit unicode characters, compress to 8-bit and return a string { 0x16, 0x00 } -0x16 |
UnicodeString |
readUnicodeString()
Returns an excel style unicode string from the bytes reminaing in the record. |
int |
readUShort()
Reads a 16 bit,un- signed value. |
int |
remaining()
The remaining number of bytes in the current record. |
void |
setAutoContinue(boolean enable)
|
Methods inherited from class java.io.InputStream |
---|
available, close, mark, markSupported, read, read, reset, skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final short MAX_RECORD_DATA_SIZE
protected short currentSid
protected short currentLength
protected short nextSid
protected byte[] data
protected short recordOffset
protected long pos
Constructor Detail |
---|
public RecordInputStream(java.io.InputStream in) throws RecordFormatException
RecordFormatException
Method Detail |
---|
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public short getSid()
public short getLength()
public short getRecordOffset()
public long getPos()
public boolean hasNextRecord()
public void nextRecord() throws RecordFormatException
RecordFormatException
public void setAutoContinue(boolean enable)
public boolean getAutoContinue()
protected void checkRecordPosition()
public byte readByte()
public short readShort()
public int readInt()
public long readLong()
public short readUByte()
public int readUShort()
public double readDouble()
public byte[] getNANData()
public short[] readShortArray()
public java.lang.String readUnicodeLEString(int length)
length
- the length of the final string
java.lang.IllegalArgumentException
- if len is too large (i.e.,
there is not enough data in string to create a String of that
length)public java.lang.String readCompressedUnicode(int length)
public UnicodeString readUnicodeString()
public byte[] readRemainder()
public byte[] readAllContinuedRemainder()
public int remaining()
public boolean isContinueNext()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |