public class RecordInputStream extends InputStream
Description: Wraps a stream and provides helper methods for the construction of records.
Modifier and Type | Field and Description |
---|---|
private boolean |
autoContinue |
protected short |
currentLength |
protected short |
currentSid |
protected byte[] |
data |
private InputStream |
in |
static short |
MAX_RECORD_DATA_SIZE
Maximum size of a single record (minus the 4 byte header) without a continue
|
(package private) byte[] |
NAN_data |
protected short |
nextSid |
protected long |
pos |
protected short |
recordOffset |
Constructor and Description |
---|
RecordInputStream(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() |
String |
readCompressedUnicode(int length) |
double |
readDouble() |
int |
readInt() |
long |
readLong() |
byte[] |
readRemainder()
Returns the remaining bytes for the current record.
|
short |
readShort() |
short[] |
readShortArray() |
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) |
available, close, mark, markSupported, read, read, reset, skip
public static final short MAX_RECORD_DATA_SIZE
private InputStream in
protected short currentSid
protected short currentLength
protected short nextSid
protected byte[] data
protected short recordOffset
protected long pos
private boolean autoContinue
byte[] NAN_data
public RecordInputStream(InputStream in) throws RecordFormatException
RecordFormatException
public int read() throws IOException
read
in class InputStream
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 String readUnicodeLEString(int length)
length
- the length of the final stringIllegalArgumentException
- if len is too large (i.e.,
there is not enough data in string to create a String of that
length)public String readCompressedUnicode(int length)
public UnicodeString readUnicodeString()
public byte[] readRemainder()
public byte[] readAllContinuedRemainder()
public int remaining()
public boolean isContinueNext()
Copyright © 2015 Open Microscopy Environment