public class LittleEndianByteArrayInputStream extends java.io.ByteArrayInputStream implements 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
|
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 |
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
- the input buffer.offset
- the offset in the buffer of the first byte to read.length
- the maximum number of bytes to read from the buffer.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
- the input buffer.offset
- the offset in the buffer of the first byte to read.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
.buf
- the input buffer.protected void checkPosition(int i)
public int getReadIndex()
public void setReadIndex(int pos)
public byte readByte()
readByte
in interface LittleEndianInput
public int readInt()
readInt
in interface LittleEndianInput
public long readLong()
readLong
in interface LittleEndianInput
public short readShort()
readShort
in interface LittleEndianInput
public int readUByte()
readUByte
in interface LittleEndianInput
public int readUShort()
readUShort
in interface LittleEndianInput
public long readUInt()
public double readDouble()
readDouble
in interface LittleEndianInput
public void readFully(byte[] buffer, int off, int len)
readFully
in interface LittleEndianInput
public void readFully(byte[] buffer)
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 fillpublic void limit(int size)
size
- the new limit - is truncated to length of internal bufferCopyright 2021 The Apache Software Foundation or its licensors, as applicable.