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.
Two attachments to Bugzilla 50779
demonstrate that a CONTINUE break can appear right in between two bytes of a unicode character
or between two bytes of a 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 LittleEndianInputpublic byte readByte()
readByte in interface LittleEndianInputpublic int readUByte()
readUByte in interface LittleEndianInputpublic short readShort()
readShort in interface LittleEndianInputpublic int readUShort()
readUShort in interface LittleEndianInputpublic int readInt()
readInt in interface LittleEndianInputpublic long readLong()
readLong in interface LittleEndianInputpublic double readDouble()
readDouble in interface LittleEndianInputpublic void readFully(byte[] buf)
readFully in interface LittleEndianInputpublic void readFully(byte[] buf,
int off,
int len)
readFully in interface LittleEndianInputpublic void readPlain(byte[] buf,
int off,
int len)
LittleEndianInputLittleEndianInput.readFully(byte[], int, int), but
for an encrypted stream the raw (unencrypted) data is filledreadPlain in interface LittleEndianInputbuf - the byte array to receive the bytesoff - the start offset into the byte arraylen - the amount of bytes to fillCopyright 2022 The Apache Software Foundation or its licensors, as applicable.