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 InputStream
getTargetInputStream()
Replies the input stream that was passed to the constructor.double
readBEDouble()
Read a Big Endian double on 8 bytes.float
readBEFloat()
Read a Big Endian float on 4 bytes.int
readBEInt()
Read an Big Endian int on 4 bytes.long
readBELong()
Read a Big Endian long on 8 bytes.short
readBEShort()
Read a Big Endian short on 2 bytes.double
readLEDouble()
Read a Little Endian double on 8 bytes.float
readLEFloat()
Read a Little Endian float on 4 bytes.int
readLEInt()
Read an Little Endian int on 4 bytes.long
readLELong()
Read a Little Endian long on 8 bytes.short
readLEShort()
Read a Little Endian short on 2 bytes.void
skipDouble()
Skip a double (8 bytes).void
skipFloat()
Skip a float (4 bytes).void
skipInt()
Skip an integer (4 bytes).void
skipLong()
Skip an integer (8 bytes).void
skipShort()
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 IOException
Read a Big Endian double on 8 bytes.- Returns:
- the value red from the input stream
- Throws:
IOException
- on error.
-
readBEFloat
public float readBEFloat() throws IOException
Read a Big Endian float on 4 bytes.- Returns:
- the value red from the input stream
- Throws:
IOException
- on error.
-
readBEInt
public int readBEInt() throws IOException
Read 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 IOException
Read 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 IOException
Read 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 IOException
Read a Little Endian double on 8 bytes.- Returns:
- the value red from the input stream
- Throws:
IOException
- on error.
-
readLEFloat
public float readLEFloat() throws IOException
Read a Little Endian float on 4 bytes.- Returns:
- the value red from the input stream
- Throws:
IOException
- on error.
-
readLEInt
public int readLEInt() throws IOException
Read an Little Endian int on 4 bytes.- Returns:
- the value red from the input stream
- Throws:
IOException
- on error.
-
readLELong
public long readLELong() throws IOException
Read a Little Endian long on 8 bytes.- Returns:
- the value red from the input stream
- Throws:
IOException
- on error.
-
readLEShort
public short readLEShort() throws IOException
Read a Little Endian short on 2 bytes.- Returns:
- the value red from the input stream
- Throws:
IOException
- on error.
-
skipDouble
public void skipDouble() throws IOException
Skip a double (8 bytes).- Throws:
IOException
- on error.
-
skipFloat
public void skipFloat() throws IOException
Skip a float (4 bytes).- Throws:
IOException
- on error.
-
skipInt
public void skipInt() throws IOException
Skip an integer (4 bytes).- Throws:
IOException
- on error.
-
skipLong
public void skipLong() throws IOException
Skip an integer (8 bytes).- Throws:
IOException
- on error.
-
skipShort
public void skipShort() throws IOException
Skip a short (2 bytes).- Throws:
IOException
- on error.
-
-