Package PamUtils
Class LittleEndianDataInputStream
java.lang.Object
java.io.InputStream
PamUtils.LittleEndianDataInputStream
- All Implemented Interfaces:
Closeable,DataInput,AutoCloseable
Copied from https://www.peterfranza.com/2008/09/26/little-endian-input-stream/
- Author:
- dg50
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintfinal voidclose()intread()final intread(byte[] b, int off, int len) final booleanfinal bytereadByte()final charreadChar()like DataInputStream.readChar except little endian.final doublefinal floatfinal voidreadFully(byte[] b) final voidreadFully(byte[] b, int off, int len) final intreadInt()like DataInputStream.readInt except little endian.final StringreadLine()Deprecated.final longreadLong()like DataInputStream.readLong except little endian.final shortfinal intfinal longlike DataInputStream.readUnsignedInt except little endian.final intNote, returns int even though it reads a short.final StringreadUTF()final longskip(long n) final intskipBytes(int n) Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skipNBytes, transferTo
-
Constructor Details
-
LittleEndianDataInputStream
-
-
Method Details
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
readShort
- Specified by:
readShortin interfaceDataInput- Throws:
IOException
-
readUnsignedShort
Note, returns int even though it reads a short.- Specified by:
readUnsignedShortin interfaceDataInput- Throws:
IOException
-
readChar
like DataInputStream.readChar except little endian.- Specified by:
readCharin interfaceDataInput- Throws:
IOException
-
readInt
like DataInputStream.readInt except little endian.- Specified by:
readIntin interfaceDataInput- Throws:
IOException
-
readUnsignedInt
like DataInputStream.readUnsignedInt except little endian.- Throws:
IOException
-
readLong
like DataInputStream.readLong except little endian.- Specified by:
readLongin interfaceDataInput- Throws:
IOException
-
readFloat
- Specified by:
readFloatin interfaceDataInput- Throws:
IOException
-
readDouble
- Specified by:
readDoublein interfaceDataInput- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
readFully
- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
readFully
- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
skipBytes
- Specified by:
skipBytesin interfaceDataInput- Throws:
IOException
-
skip
- Overrides:
skipin classInputStream- Throws:
IOException
-
readBoolean
- Specified by:
readBooleanin interfaceDataInput- Throws:
IOException
-
readByte
- Specified by:
readBytein interfaceDataInput- Throws:
IOException
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
readUnsignedByte
- Specified by:
readUnsignedBytein interfaceDataInput- Throws:
IOException
-
readLine
Deprecated.- Specified by:
readLinein interfaceDataInput- Throws:
IOException
-
readUTF
- Specified by:
readUTFin interfaceDataInput- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-