public class LittleEndianByteArrayInputStream extends java.io.ByteArrayInputStream implements LittleEndianInput
LittleEndianInput
(将纯字节数组适配到 LittleEndianInput)
Constructor and Description |
---|
LittleEndianByteArrayInputStream(byte[] buf)
Creates a
LittleEndianByteArrayInputStream so that it uses
buf as its buffer array.
|
LittleEndianByteArrayInputStream(byte[] buf, int offset)
Creates
LittleEndianByteArrayInputStream that uses
buf as its buffer array.
|
LittleEndianByteArrayInputStream(byte[] buf, int offset, int length)
Creates
LittleEndianByteArrayInputStream that uses
buf as its buffer array.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkPosition(int i) |
int |
getReadIndex() |
void |
limit(int size)
Change the limit of the ByteArrayInputStream
(更改 ByteArrayInputStream 的限制)
|
byte |
readByte() |
double |
readDouble() |
void |
readFully(byte[] buffer) |
void |
readFully(byte[] buffer, 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() |
int |
readUShort() |
void |
setReadIndex(int pos) |
available, close, mark, markSupported, read, read, reset, skip
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
available
public LittleEndianByteArrayInputStream(byte[] buf, int offset, int length)
LittleEndianByteArrayInputStream
that uses
buf
as its buffer array. The initial value of
pos
is
offset
and the initial value of
count
is the minimum of
offset+length
and
buf.length
. The buffer array is not copied. The buffer's mark is set to the specified offset.
(创建使用 buf 作为其缓冲区数组的 LittleEndianByteArrayInputStream。 pos的初始值为offset,count的初始值为offset+length和buf.length的最小值。不复制缓冲区数组。缓冲区的标记设置为指定的偏移量。)
buf
- the input buffer.
(buf - 输入缓冲区。)
offset
- the offset in the buffer of the first byte to read.
(offset - 要读取的第一个字节在缓冲区中的偏移量。)
length
- the maximum number of bytes to read from the buffer.
(length - 从缓冲区读取的最大字节数。)
public LittleEndianByteArrayInputStream(byte[] buf, int offset)
LittleEndianByteArrayInputStream
that uses
buf
as its buffer array. The initial value of
pos
is
offset
and the initial value of
count
is the minimum of
offset+buf.length
and
buf.length
. The buffer array is not copied. The buffer's mark is set to the specified offset.
(创建使用 buf 作为其缓冲区数组的 LittleEndianByteArrayInputStream。 pos的初始值为offset,count的初始值为offset+buf.length和buf.length的最小值。不复制缓冲区数组。缓冲区的标记设置为指定的偏移量。)
buf
- the input buffer.
(buf - 输入缓冲区。)
offset
- the offset in the buffer of the first byte to read.
(offset - 要读取的第一个字节在缓冲区中的偏移量。)
public LittleEndianByteArrayInputStream(byte[] buf)
LittleEndianByteArrayInputStream
so that it uses
buf
as its buffer array. The buffer array is not copied. The initial value of
pos
is
0
and the initial value of
count
is the length of
buf
.
(创建一个 LittleEndianByteArrayInputStream 以便它使用 buf 作为其缓冲区数组。不复制缓冲区数组。 pos的初值为0,count的初值为buf的长度。)
buf
- the input buffer.
(buf - 输入缓冲区。)
protected void checkPosition(int i)
public int getReadIndex()
public void setReadIndex(int pos)
public byte readByte()
readByte
in interface
LittleEndianInput
(接口 LittleEndianInput 中的 readByte)
public int readInt()
readInt
in interface
LittleEndianInput
(接口 LittleEndianInput 中的 readInt)
public long readLong()
readLong
in interface
LittleEndianInput
(接口 LittleEndianInput 中的 readLong)
public short readShort()
readShort
in interface
LittleEndianInput
(接口 LittleEndianInput 中的 readShort)
public int readUByte()
readUByte
in interface
LittleEndianInput
(接口 LittleEndianInput 中的 readUByte)
public int readUShort()
readUShort
in interface
LittleEndianInput
(接口 LittleEndianInput 中的 readUShort)
public long readUInt()
public double readDouble()
readDouble
in interface
LittleEndianInput
(接口 LittleEndianInput 中的 readDouble)
public void readFully(byte[] buffer, int off, int len)
readFully
in interface
LittleEndianInput
(接口 LittleEndianInput 中的 readFully)
public void readFully(byte[] buffer)
readFully
in interface
LittleEndianInput
(接口 LittleEndianInput 中的 readFully)
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 limit(int size)
size
- the new limit - is truncated to length of internal buffer
(size - 新的限制 - 被截断为内部缓冲区的长度)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.