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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new LittleEndian reader from the given input stream. -
Method Summary
Modifier and TypeMethodDescriptionfinal intfinal voidclose()final booleanfinal bytereadByte()final charreadChar()final doublefinal floatfinal voidreadFully(byte[] b) final voidreadFully(byte[] b, int off, int len) final intreadInt()final StringreadLine()final longreadLong()final shortfinal intfinal longread an unsigned int as a longfinal intfinal StringreadUTF()final intskipBytes(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:
readUnsignedShortin 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:
readBooleanin interfaceDataInput- Throws:
IOException
-
readByte
- Specified by:
readBytein interfaceDataInput- Throws:
IOException
-
readUnsignedByte
- Specified by:
readUnsignedBytein interfaceDataInput- Throws:
IOException
-
readShort
- Specified by:
readShortin interfaceDataInput- Throws:
IOException
-
readChar
- Specified by:
readCharin interfaceDataInput- Throws:
IOException
-
readInt
- Specified by:
readIntin interfaceDataInput- Throws:
IOException
-
readLong
- Specified by:
readLongin interfaceDataInput- Throws:
IOException
-
readFloat
- Specified by:
readFloatin interfaceDataInput- Throws:
IOException
-
readDouble
- Specified by:
readDoublein interfaceDataInput- Throws:
IOException
-
readFully
- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
readFully
- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
skipBytes
- Specified by:
skipBytesin interfaceDataInput- Throws:
IOException
-
readLine
- Specified by:
readLinein interfaceDataInput- Throws:
IOException
-
readUTF
- Specified by:
readUTFin interfaceDataInput- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-
available
- Throws:
IOException
-