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.
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
|
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() |
long |
readUInt()
get an unsigned int value from an InputStream
|
int |
readUShort() |
void |
reset() |
void |
skipFully(int len) |
public int available()
available
in interface LittleEndianInput
available
in class java.io.FilterInputStream
public byte readByte()
readByte
in interface LittleEndianInput
public int readUByte()
readUByte
in interface LittleEndianInput
public float readFloat()
public double readDouble()
readDouble
in interface LittleEndianInput
public int readInt()
readInt
in interface LittleEndianInput
public long readUInt()
java.lang.RuntimeException
- wraps any IOException thrown from reading the stream.public long readLong()
readLong
in interface LittleEndianInput
public short readShort()
readShort
in interface LittleEndianInput
public int readUShort()
readUShort
in interface LittleEndianInput
public void readFully(byte[] buf)
readFully
in interface LittleEndianInput
public void readFully(byte[] buf, int off, int len)
readFully
in interface LittleEndianInput
public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.FilterInputStream
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
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 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 skipFully(int len) throws java.io.IOException
java.io.IOException
Copyright 2022 The Apache Software Foundation or its licensors, as applicable.