Package htsjdk.tribble.util
Class LittleEndianInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- htsjdk.tribble.util.LittleEndianInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class LittleEndianInputStream extends FilterInputStream
Input stream with methods to convert byte arrays to numeric values using "little endian" order. Note: This class is not thread safe => instances should not be shared amongst threads
-
-
Field Summary
-
Fields inherited from class java.io.FilterInputStream
in
-
-
Constructor Summary
Constructors Constructor Description LittleEndianInputStream(InputStream in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description bytereadByte()doublereadDouble()floatreadFloat()intreadInt()longreadLong()shortreadShort()StringreadString()Read a null terminated byte array and return result as a string-
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, read, read, reset, skip
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
LittleEndianInputStream
public LittleEndianInputStream(InputStream in)
-
-
Method Detail
-
readByte
public byte readByte() throws IOException- Returns:
- the next byte of this input stream, interpreted as an unsigned 8-bit number
- Throws:
IOException
-
readShort
public short readShort() throws IOException- Throws:
IOException
-
readInt
public int readInt() throws IOException- Throws:
IOException
-
readLong
public long readLong() throws IOException- Throws:
IOException
-
readDouble
public final double readDouble() throws IOException- Throws:
IOException
-
readFloat
public final float readFloat() throws IOException- Throws:
IOException
-
readString
public String readString() throws IOException
Read a null terminated byte array and return result as a string- Returns:
- Throws:
IOException
-
-