|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.poi.hssf.record.RecordInputStream
public final class RecordInputStream
Title: Record Input Stream
Description: Wraps a stream and provides helper methods for the construction of records.
| Nested Class Summary | |
|---|---|
static class |
RecordInputStream.LeftoverDataException
For use in BiffViewer which may construct Records that don't completely
read all available data. |
| Field Summary | |
|---|---|
static short |
MAX_RECORD_DATA_SIZE
Maximum size of a single record (minus the 4 byte header) without a continue |
| Constructor Summary | |
|---|---|
RecordInputStream(java.io.InputStream in)
|
|
RecordInputStream(java.io.InputStream in,
EncryptionInfo key,
int initialOffset)
|
|
| Method Summary | |
|---|---|
int |
available()
|
int |
getNextSid()
|
short |
getSid()
|
boolean |
hasNextRecord()
Note - this method is expected to be called only when completed reading the current BIFF record. |
void |
mark(int readlimit)
Mark the stream position - experimental function |
void |
nextRecord()
Moves to the next record in the stream. |
int |
read(byte[] b,
int off,
int len)
|
byte[] |
readAllContinuedRemainder()
Deprecated. POI 2.0 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 requestedLength)
|
double |
readDouble()
|
void |
readFully(byte[] buf)
|
void |
readFully(byte[] buf,
int off,
int len)
|
protected void |
readFully(byte[] buf,
int off,
int len,
boolean isPlain)
|
int |
readInt()
Reads a 32 bit, signed value |
long |
readLong()
Reads a 64 bit, signed value |
void |
readPlain(byte[] buf,
int off,
int len)
Usually acts the same as LittleEndianInput.readFully(byte[], int, int), but
for an encrypted stream the raw (unencrypted) data is filled |
byte[] |
readRemainder()
Returns the remaining bytes for the current record. |
short |
readShort()
Reads a 16 bit, signed value |
java.lang.String |
readString()
|
int |
readUByte()
Reads an 8 bit, unsigned value |
java.lang.String |
readUnicodeLEString(int requestedLength)
given a byte array of 16-bit unicode characters, compress to 8-bit and return a string { 0x16, 0x00 } -0x16 |
int |
readUShort()
Reads a 16 bit, unsigned value. |
int |
remaining()
The remaining number of bytes in the current record. |
void |
reset()
Resets the stream position to the previously marked position. |
| 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
| Constructor Detail |
|---|
public RecordInputStream(java.io.InputStream in)
throws RecordFormatException
RecordFormatException
public RecordInputStream(java.io.InputStream in,
EncryptionInfo key,
int initialOffset)
throws RecordFormatException
RecordFormatException| Method Detail |
|---|
public int available()
available in interface LittleEndianInputremaining()
public int read(byte[] b,
int off,
int len)
public short getSid()
public boolean hasNextRecord()
throws RecordInputStream.LeftoverDataException
RecordInputStream.LeftoverDataException - if this method is called before reaching the end of the
current record.
public void nextRecord()
throws RecordFormatException
RecordFormatExceptionpublic byte readByte()
readByte in interface LittleEndianInputpublic short readShort()
readShort in interface LittleEndianInputpublic int readInt()
readInt in interface LittleEndianInputpublic long readLong()
readLong in interface LittleEndianInputpublic int readUByte()
readUByte in interface LittleEndianInputpublic int readUShort()
readUShort in interface LittleEndianInputpublic double readDouble()
readDouble in interface LittleEndianInput
public void readPlain(byte[] buf,
int off,
int len)
LittleEndianInputLittleEndianInput.readFully(byte[], int, int), but
for an encrypted stream the raw (unencrypted) data is filled
readPlain in interface LittleEndianInputbuf - the byte array to receive the bytesoff - the start offset into the byte arraylen - the amount of bytes to fillpublic void readFully(byte[] buf)
readFully in interface LittleEndianInput
public void readFully(byte[] buf,
int off,
int len)
readFully in interface LittleEndianInput
protected void readFully(byte[] buf,
int off,
int len,
boolean isPlain)
public java.lang.String readString()
public java.lang.String readUnicodeLEString(int requestedLength)
requestedLength - 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 requestedLength)
public byte[] readRemainder()
@Deprecated public byte[] readAllContinuedRemainder()
public int remaining()
public int getNextSid()
@Internal public void mark(int readlimit)
readlimit - the read ahead limitInputStream.mark(int)
@Internal
public void reset()
throws java.io.IOException
java.io.IOException - if marking is not supportedInputStream.reset()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||