public final class RecordInputStream extends java.lang.Object implements LittleEndianInput
Modifier and Type | Class and Description |
---|---|
static class |
RecordInputStream.LeftoverDataException
For use in
BiffViewer which may construct
Record s that don't completely read all available data.
(用于 BiffViewer,它可能构建不完全读取所有可用数据的记录。)
|
Modifier and Type | Field and Description |
---|---|
static short |
MAX_RECORD_DATA_SIZE
Maximum size of a single record (minus the 4 byte header) without a continue
(没有继续的单个记录的最大大小(减去 4 字节标头))
|
Constructor and Description |
---|
RecordInputStream(java.io.InputStream in) |
RecordInputStream(java.io.InputStream in, EncryptionInfo key, int initialOffset) |
Modifier and Type | Method and Description |
---|---|
int |
available() |
int |
getNextSid() |
short |
getSid() |
boolean |
hasNextRecord()
Note - this method is expected to be called only when completed reading the current BIFF record.
(注意 - 只有在完成当前 BIFF 记录的读取时才会调用此方法。)
|
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.
(已弃用。 POI 2.0 最好编写一个输入流来包装这个输入流,其中有可能与继续记录重叠的特殊子记录。)
|
byte |
readByte()
Reads an 8 bit, signed value
(读取 8 位有符号值)
|
java.lang.String |
readCompressedUnicode(int requestedLength) |
double |
readDouble() |
void |
readFully(byte[] buf) |
void |
readFully(byte[] buf, int off, int len) |
int |
readInt()
Reads a 32 bit, signed value
(读取 32 位有符号值)
|
long |
readLong()
Reads a 64 bit, signed value
(读取 64 位有符号值)
|
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
(通常行为与 LittleEndianInput.readFully(byte[], int, int) 相同,但对于加密流,原始(未加密)数据被填充)
|
byte[] |
readRemainder()
Returns the remaining bytes for the current record.
(返回当前记录的剩余字节。)
|
short |
readShort()
Reads a 16 bit, signed value
(读取 16 位有符号值)
|
java.lang.String |
readString() |
int |
readUByte()
Reads an 8 bit, unsigned value
(读取 8 位无符号值)
|
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
(给定一个 16 位 unicode 字符的字节数组,压缩为 8 位并返回一个字符串 { 0x16, 0x00 } -0x16)
|
int |
readUShort()
Reads a 16 bit, unsigned value.
(读取 16 位无符号值。)
|
int |
remaining()
The remaining number of bytes in the
current record.
(当前记录中剩余的字节数。)
|
void |
reset()
Resets the stream position to the previously marked position.
(将流位置重置为先前标记的位置。)
|
public static final short MAX_RECORD_DATA_SIZE
public RecordInputStream(java.io.InputStream in) throws RecordFormatException
RecordFormatException
(记录格式异常)
public RecordInputStream(java.io.InputStream in, EncryptionInfo key, int initialOffset) throws RecordFormatException
RecordFormatException
(记录格式异常)
public int available()
available
in interface
LittleEndianInput
(在接口 LittleEndianInput 中可用)
remaining()
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.
(RecordInputStream.LeftoverDataException - 如果在到达当前记录末尾之前调用此方法。)
public void nextRecord() throws RecordFormatException
RecordFormatException
(记录格式异常)
public byte readByte()
readByte
in interface
LittleEndianInput
(接口 LittleEndianInput 中的 readByte)
public short readShort()
readShort
in interface
LittleEndianInput
(接口 LittleEndianInput 中的 readShort)
public int readInt()
readInt
in interface
LittleEndianInput
(接口 LittleEndianInput 中的 readInt)
public long readLong()
readLong
in interface
LittleEndianInput
(接口 LittleEndianInput 中的 readLong)
public int readUByte()
readUByte
in interface
LittleEndianInput
(接口 LittleEndianInput 中的 readUByte)
public int readUShort()
readUShort
in interface
LittleEndianInput
(接口 LittleEndianInput 中的 readUShort)
public double readDouble()
readDouble
in interface
LittleEndianInput
(接口 LittleEndianInput 中的 readDouble)
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 filled
(通常行为与 LittleEndianInput.readFully(byte[], int, int) 相同,但对于加密流,原始(未加密)数据被填充)
readPlain
in interface
LittleEndianInput
(接口 LittleEndianInput 中的 readPlain)
buf
- the byte array to receive the bytes
(buf - 接收字节的字节数组)
off
- the start offset into the byte array
(off - 字节数组的起始偏移量)
len
- the amount of bytes to fill
(len - 要填充的字节数)
public void readFully(byte[] buf)
readFully
in interface
LittleEndianInput
(接口 LittleEndianInput 中的 readFully)
public void readFully(byte[] buf, int off, int len)
readFully
in interface
LittleEndianInput
(接口 LittleEndianInput 中的 readFully)
public java.lang.String readString()
public java.lang.String readUnicodeLEString(int requestedLength)
requestedLength
- the length of the final string
(requestedLength - 最终字符串的长度)
java.lang.IllegalArgumentException
- if len is too large (i.e., there is not enough data in string to create a String of that length)
(java.lang.IllegalArgumentException - 如果 len 太大(即,字符串中没有足够的数据来创建该长度的字符串))
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 limit
(readlimit - 预读限制)
InputStream.mark(int)
@Internal public void reset() throws java.io.IOException
java.io.IOException
- if marking is not supported
(java.io.IOException - 如果不支持标记)
InputStream.reset()
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.