Package org.apache.poi.util
Class LittleEndianInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- org.apache.poi.util.LittleEndianInputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,LittleEndianInput
- Direct Known Subclasses:
ChunkedCipherInputStream
public class LittleEndianInputStream extends java.io.FilterInputStream implements LittleEndianInput
Wraps anInputStream
providingLittleEndianInput
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 Summary
Constructors Constructor Description LittleEndianInputStream(java.io.InputStream is)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
byte
readByte()
double
readDouble()
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 asLittleEndianInput.readFully(byte[], int, int)
, but for an encrypted stream the raw (unencrypted) data is filledshort
readShort()
int
readUByte()
long
readUInt()
get an unsigned int value from an InputStreamint
readUShort()
-
Methods inherited from class java.io.FilterInputStream
close, mark, markSupported, read, read, read, reset, skip
-
-
-
-
Method Detail
-
available
public int available()
- Specified by:
available
in interfaceLittleEndianInput
- Overrides:
available
in classjava.io.FilterInputStream
-
readByte
public byte readByte()
- Specified by:
readByte
in interfaceLittleEndianInput
-
readUByte
public int readUByte()
- Specified by:
readUByte
in interfaceLittleEndianInput
-
readDouble
public double readDouble()
- Specified by:
readDouble
in interfaceLittleEndianInput
-
readInt
public int readInt()
- Specified by:
readInt
in interfaceLittleEndianInput
-
readUInt
public long readUInt()
get an unsigned int value from an InputStream- Returns:
- the unsigned int (32-bit) value
- Throws:
java.lang.RuntimeException
- wraps any IOException thrown from reading the stream.
-
readLong
public long readLong()
- Specified by:
readLong
in interfaceLittleEndianInput
-
readShort
public short readShort()
- Specified by:
readShort
in interfaceLittleEndianInput
-
readUShort
public int readUShort()
- Specified by:
readUShort
in interfaceLittleEndianInput
-
readFully
public void readFully(byte[] buf)
- Specified by:
readFully
in interfaceLittleEndianInput
-
readFully
public void readFully(byte[] buf, int off, int len)
- Specified by:
readFully
in interfaceLittleEndianInput
-
readPlain
public void readPlain(byte[] buf, int off, int len)
Description copied from interface:LittleEndianInput
Usually acts the same asLittleEndianInput.readFully(byte[], int, int)
, but for an encrypted stream the raw (unencrypted) data is filled- Specified by:
readPlain
in interfaceLittleEndianInput
- Parameters:
buf
- the byte array to receive the bytesoff
- the start offset into the byte arraylen
- the amount of bytes to fill
-
-