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 TypeMethodDescriptionint
final void
close()
int
read()
final int
read
(byte[] b, int off, int len) final boolean
final byte
readByte()
final char
readChar()
like DataInputStream.readChar except little endian.final double
final float
final void
readFully
(byte[] b) final void
readFully
(byte[] b, int off, int len) final int
readInt()
like DataInputStream.readInt except little endian.final String
readLine()
Deprecated.final long
readLong()
like DataInputStream.readLong except little endian.final short
final int
final long
like DataInputStream.readUnsignedInt except little endian.final int
Note, returns int even though it reads a short.final String
readUTF()
final long
skip
(long n) final int
skipBytes
(int n) Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skipNBytes, transferTo
-
Constructor Details
-
Method Details
-
available
- Overrides:
available
in classInputStream
- Throws:
IOException
-
readShort
- Specified by:
readShort
in interfaceDataInput
- Throws:
IOException
-
readUnsignedShort
Note, returns int even though it reads a short.- Specified by:
readUnsignedShort
in interfaceDataInput
- Throws:
IOException
-
readChar
like DataInputStream.readChar except little endian.- Specified by:
readChar
in interfaceDataInput
- Throws:
IOException
-
readInt
like DataInputStream.readInt except little endian.- Specified by:
readInt
in interfaceDataInput
- Throws:
IOException
-
readUnsignedInt
like DataInputStream.readUnsignedInt except little endian.- Throws:
IOException
-
readLong
like DataInputStream.readLong except little endian.- Specified by:
readLong
in interfaceDataInput
- Throws:
IOException
-
readFloat
- Specified by:
readFloat
in interfaceDataInput
- Throws:
IOException
-
readDouble
- Specified by:
readDouble
in interfaceDataInput
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- 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
-
skip
- Overrides:
skip
in classInputStream
- Throws:
IOException
-
readBoolean
- Specified by:
readBoolean
in interfaceDataInput
- Throws:
IOException
-
readByte
- Specified by:
readByte
in interfaceDataInput
- Throws:
IOException
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
readUnsignedByte
- Specified by:
readUnsignedByte
in interfaceDataInput
- Throws:
IOException
-
readLine
Deprecated.- Specified by:
readLine
in interfaceDataInput
- Throws:
IOException
-
readUTF
- Specified by:
readUTF
in interfaceDataInput
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-