public class RecordInputStream
extends java.io.InputStream
Description: Wraps a stream and provides helper methods for the construction of records.
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
RecordInputStream(java.io.InputStream in) |
Modifier and Type | Method and Description |
---|---|
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() |
java.lang.String |
readCompressedUnicode(int length) |
double |
readDouble() |
int |
readInt() |
long |
readLong() |
byte[] |
readRemainder()
Returns the remaining bytes for the current record.
|
short |
readShort() |
short[] |
readShortArray() |
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() |
int |
remaining()
The remaining number of bytes in the current record.
|
void |
setAutoContinue(boolean enable) |
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
public RecordInputStream(java.io.InputStream in) throws RecordFormatException
RecordFormatException
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 int readUShort()
public double readDouble()
public byte[] getNANData()
public short[] readShortArray()
public java.lang.String readUnicodeLEString(int length)
length
- the length of the final stringjava.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()
Copyright © 2014 Open Microscopy Environment