Class LittleEndianDataInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- java.io.DataInputStream
-
- org.arakhne.afc.inputoutput.stream.LittleEndianDataInputStream
-
- All Implemented Interfaces:
Closeable,DataInput,AutoCloseable
public class LittleEndianDataInputStream extends DataInputStream
This class permits to read a stream with Little Endian encoding.- Since:
- 14.0
- Version:
- 17.0 2020-01-04 14:41:40
- Author:
- Olivier LAMOTTE, Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- inputoutput
-
-
Field Summary
-
Fields inherited from class java.io.FilterInputStream
in
-
-
Constructor Summary
Constructors Constructor Description LittleEndianDataInputStream(InputStream inputStream)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStreamgetTargetInputStream()Replies the input stream that was passed to the constructor.doublereadBEDouble()Read a Big Endian double on 8 bytes.floatreadBEFloat()Read a Big Endian float on 4 bytes.intreadBEInt()Read an Big Endian int on 4 bytes.longreadBELong()Read a Big Endian long on 8 bytes.shortreadBEShort()Read a Big Endian short on 2 bytes.doublereadLEDouble()Read a Little Endian double on 8 bytes.floatreadLEFloat()Read a Little Endian float on 4 bytes.intreadLEInt()Read an Little Endian int on 4 bytes.longreadLELong()Read a Little Endian long on 8 bytes.shortreadLEShort()Read a Little Endian short on 2 bytes.voidskipDouble()Skip a double (8 bytes).voidskipFloat()Skip a float (4 bytes).voidskipInt()Skip an integer (4 bytes).voidskipLong()Skip an integer (8 bytes).voidskipShort()Skip a short (2 bytes).-
Methods inherited from class java.io.DataInputStream
read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, readUTF, skipBytes
-
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, reset, skip
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
LittleEndianDataInputStream
public LittleEndianDataInputStream(InputStream inputStream)
Constructor.- Parameters:
inputStream- is the input stream to read from.
-
-
Method Detail
-
getTargetInputStream
public InputStream getTargetInputStream()
Replies the input stream that was passed to the constructor.- Returns:
- the input stream that was passed to the constructor;
-
readBEDouble
public double readBEDouble() throws IOExceptionRead a Big Endian double on 8 bytes.- Returns:
- the value red from the input stream
- Throws:
IOException- on error.
-
readBEFloat
public float readBEFloat() throws IOExceptionRead a Big Endian float on 4 bytes.- Returns:
- the value red from the input stream
- Throws:
IOException- on error.
-
readBEInt
public int readBEInt() throws IOExceptionRead an Big Endian int on 4 bytes.According to the contract of
DataInput.readInt()this function is equivalent to.- Returns:
- the value red from the input stream
- Throws:
IOException- on error.
-
readBELong
public long readBELong() throws IOExceptionRead a Big Endian long on 8 bytes.According to the contract of
DataInput.readLong()this function is equivalent to.- Returns:
- the value red from the input stream
- Throws:
IOException- on error.
-
readBEShort
public short readBEShort() throws IOExceptionRead a Big Endian short on 2 bytes.According to the contract of
DataInput.readShort()this function is equivalent to.- Returns:
- the value red from the input stream
- Throws:
IOException- on error.
-
readLEDouble
public double readLEDouble() throws IOExceptionRead a Little Endian double on 8 bytes.- Returns:
- the value red from the input stream
- Throws:
IOException- on error.
-
readLEFloat
public float readLEFloat() throws IOExceptionRead a Little Endian float on 4 bytes.- Returns:
- the value red from the input stream
- Throws:
IOException- on error.
-
readLEInt
public int readLEInt() throws IOExceptionRead an Little Endian int on 4 bytes.- Returns:
- the value red from the input stream
- Throws:
IOException- on error.
-
readLELong
public long readLELong() throws IOExceptionRead a Little Endian long on 8 bytes.- Returns:
- the value red from the input stream
- Throws:
IOException- on error.
-
readLEShort
public short readLEShort() throws IOExceptionRead a Little Endian short on 2 bytes.- Returns:
- the value red from the input stream
- Throws:
IOException- on error.
-
skipDouble
public void skipDouble() throws IOExceptionSkip a double (8 bytes).- Throws:
IOException- on error.
-
skipFloat
public void skipFloat() throws IOExceptionSkip a float (4 bytes).- Throws:
IOException- on error.
-
skipInt
public void skipInt() throws IOExceptionSkip an integer (4 bytes).- Throws:
IOException- on error.
-
skipLong
public void skipLong() throws IOExceptionSkip an integer (8 bytes).- Throws:
IOException- on error.
-
skipShort
public void skipShort() throws IOExceptionSkip a short (2 bytes).- Throws:
IOException- on error.
-
-