public class ContinuableRecordInput extends java.lang.Object implements LittleEndianInput
RecordInputStream
that can read primitive data types
(short, int, long, etc.) spanned across a ContinueRecord
boundary.
Most records construct themselves from RecordInputStream
.
This class assumes that a ContinueRecord
record 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.
RecordInputStream
greedily requests the bytes to be read and stumbles on such files with a
"Not enough data (1) to read requested (2) bytes" exception. The ContinuableRecordInput
class 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
blocks of a UnicodeString.
Constructor and Description |
---|
ContinuableRecordInput(RecordInputStream in) |
Modifier and Type | Method and Description |
---|---|
int |
available() |
byte |
readByte() |
double |
readDouble() |
void |
readFully(byte[] buf) |
void |
readFully(byte[] buf,
int off,
int len) |
int |
readInt() |
long |
readLong() |
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 |
short |
readShort() |
int |
readUByte() |
int |
readUShort() |
public ContinuableRecordInput(RecordInputStream in)
public int available()
available
in interface LittleEndianInput
public byte readByte()
readByte
in interface LittleEndianInput
public int readUByte()
readUByte
in interface LittleEndianInput
public short readShort()
readShort
in interface LittleEndianInput
public int readUShort()
readUShort
in interface LittleEndianInput
public int readInt()
readInt
in interface LittleEndianInput
public long readLong()
readLong
in interface LittleEndianInput
public double readDouble()
readDouble
in interface LittleEndianInput
public void readFully(byte[] buf)
readFully
in interface LittleEndianInput
public void readFully(byte[] buf, int off, int len)
readFully
in interface LittleEndianInput
public void readPlain(byte[] buf, int off, int len)
LittleEndianInput
LittleEndianInput.readFully(byte[], int, int)
, but
for an encrypted stream the raw (unencrypted) data is filledreadPlain
in interface LittleEndianInput
buf
- the byte array to receive the bytesoff
- the start offset into the byte arraylen
- the amount of bytes to fillCopyright 2020 The Apache Software Foundation or its licensors, as applicable.