Package com.ardor3d.util
Class LittleEndianDataInput
java.lang.Object
com.ardor3d.util.LittleEndianDataInput
- All Implemented Interfaces:
DataInput
,AutoCloseable
LittleEndianDataInput is a class to read little-endian stored data via a InputStream. All functions work as defined
in DataInput, but assume they come from a LittleEndian input stream.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreates a new LittleEndian reader from the given input stream. -
Method Summary
Modifier and TypeMethodDescriptionfinal int
final void
close()
final boolean
final byte
readByte()
final char
readChar()
final double
final float
final void
readFully
(byte[] b) final void
readFully
(byte[] b, int off, int len) final int
readInt()
final String
readLine()
final long
readLong()
final short
final int
final long
read an unsigned int as a longfinal int
final String
readUTF()
final int
skipBytes
(int n)
-
Field Details
-
CHAR_SIZE
public int CHAR_SIZENumber of bytes to read when reading a char... For data meant to be read from C/C++ this is often 1, for Java and C# this is usually 2.
-
-
Constructor Details
-
LittleEndianDataInput
Creates a new LittleEndian reader from the given input stream. The stream is wrapped in a BufferedInputStream automatically.- Parameters:
in
- The input stream to read from.
-
-
Method Details
-
readUnsignedShort
- Specified by:
readUnsignedShort
in interfaceDataInput
- Throws:
IOException
-
readUnsignedInt
read an unsigned int as a long- Returns:
- an unsigned int as a long
- Throws:
IOException
- if something wrong occurs while reading
-
readBoolean
- Specified by:
readBoolean
in interfaceDataInput
- Throws:
IOException
-
readByte
- Specified by:
readByte
in interfaceDataInput
- Throws:
IOException
-
readUnsignedByte
- Specified by:
readUnsignedByte
in interfaceDataInput
- Throws:
IOException
-
readShort
- Specified by:
readShort
in interfaceDataInput
- Throws:
IOException
-
readChar
- Specified by:
readChar
in interfaceDataInput
- Throws:
IOException
-
readInt
- Specified by:
readInt
in interfaceDataInput
- Throws:
IOException
-
readLong
- Specified by:
readLong
in interfaceDataInput
- Throws:
IOException
-
readFloat
- Specified by:
readFloat
in interfaceDataInput
- Throws:
IOException
-
readDouble
- Specified by:
readDouble
in interfaceDataInput
- Throws:
IOException
-
readFully
- Specified by:
readFully
in interfaceDataInput
- Throws:
IOException
-
readFully
- Specified by:
readFully
in interfaceDataInput
- Throws:
IOException
-
skipBytes
- Specified by:
skipBytes
in interfaceDataInput
- Throws:
IOException
-
readLine
- Specified by:
readLine
in interfaceDataInput
- Throws:
IOException
-
readUTF
- Specified by:
readUTF
in interfaceDataInput
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
-
available
- Throws:
IOException
-