public class LittleEndianInputStream extends java.io.FilterInputStream implements LittleEndianInput
InputStream
providing
LittleEndianInput
This class does not buffer any input, so the stream read position maintained by this class is consistent with that of the inner stream.
(包装一个 InputStream 提供 LittleEndianInput 该类不缓冲任何输入,因此该类维护的流读取位置与内部流的读取位置一致。)Constructor and Description |
---|
LittleEndianInputStream(java.io.InputStream is) |
Modifier and Type | Method and Description |
---|---|
int |
available() |
int |
getReadIndex() |
void |
mark(int readlimit) |
int |
read(byte[] b, int off, int len) |
byte |
readByte() |
double |
readDouble() |
float |
readFloat()
get a float value, reads it in little endian format then converts the resulting revolting IEEE 754 (curse them) floating point number to a happy java float
(获取一个浮点值,以小端格式读取,然后将产生的令人反感的 IEEE 754(诅咒它们)浮点数转换为快乐的 java 浮点数)
|
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
(通常行为与 LittleEndianInput.readFully(byte[], int, int) 相同,但对于加密流,原始(未加密)数据被填充)
|
short |
readShort() |
int |
readUByte() |
long |
readUInt()
get an unsigned int value from an InputStream
(从 InputStream 获取无符号整数值)
|
int |
readUShort() |
void |
reset() |
void |
skipFully(int len) |
public int available()
available
in interface
LittleEndianInput
(在接口 LittleEndianInput 中可用)
available
in class
java.io.FilterInputStream
public byte readByte()
readByte
in interface
LittleEndianInput
(接口 LittleEndianInput 中的 readByte)
public int readUByte()
readUByte
in interface
LittleEndianInput
(接口 LittleEndianInput 中的 readUByte)
public float readFloat()
public double readDouble()
readDouble
in interface
LittleEndianInput
(接口 LittleEndianInput 中的 readDouble)
public int readInt()
readInt
in interface
LittleEndianInput
(接口 LittleEndianInput 中的 readInt)
public long readUInt()
java.lang.RuntimeException
- wraps any IOException thrown from reading the stream.
(java.lang.RuntimeException - 包装从读取流中抛出的任何 IOException。)
public long readLong()
readLong
in interface
LittleEndianInput
(接口 LittleEndianInput 中的 readLong)
public short readShort()
readShort
in interface
LittleEndianInput
(接口 LittleEndianInput 中的 readShort)
public int readUShort()
readUShort
in interface
LittleEndianInput
(接口 LittleEndianInput 中的 readUShort)
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 int read(byte[] b, int off, int len) throws java.io.IOException
read
in class
java.io.FilterInputStream
java.io.IOException
(java.io.IOException)
public void mark(int readlimit)
mark
in class
java.io.FilterInputStream
public void reset() throws java.io.IOException
reset
in class
java.io.FilterInputStream
java.io.IOException
(java.io.IOException)
public int getReadIndex()
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 skipFully(int len) throws java.io.IOException
java.io.IOException
(java.io.IOException)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.