Package org.locationtech.jts.jump.io
Class EndianDataInputStream
- java.lang.Object
-
- org.locationtech.jts.jump.io.EndianDataInputStream
-
public class EndianDataInputStream extends Object
A class that gives most of the functionality of DataInputStream, but is endian aware. Uses a real java.io.DataInputStream to actually do the writing.
-
-
Constructor Summary
Constructors Constructor Description EndianDataInputStream(InputStream in)
Creates new EndianDataInputStream
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
close the streambyte
readByteBE()
read a byte in BigEndian - the same as LE because its only 1 bytebyte
readByteLE()
read a byte in LittleEndian - the same as BE because its only 1 bytevoid
readByteLEnum(byte[] b)
read a byte in LittleEndian - the same as BE because its only 1 bytedouble
readDoubleBE()
read a 64bit double in BEdouble
readDoubleLE()
read a 64bit double in LEint
readIntBE()
read a 32bit int in BEint
readIntLE()
read a 32bit int in LElong
readLongBE()
read a 64bit long in BElong
readLongLE()
read a 64bit long in LEshort
readShortBE()
read a 16bit short in BEshort
readShortLE()
read a 16bit short in LEint
readUnsignedByteBE()
read a byte in BigEndian - the same as LE because its only 1 byte.int
readUnsignedByteLE()
read a byte in LittleEndian - the same as BE because its only 1 byte.int
skipBytes(int num)
skip ahead in the stream
-
-
-
Constructor Detail
-
EndianDataInputStream
public EndianDataInputStream(InputStream in)
Creates new EndianDataInputStream
-
-
Method Detail
-
close
public void close() throws IOException
close the stream- Throws:
IOException
-
readByteBE
public byte readByteBE() throws IOException
read a byte in BigEndian - the same as LE because its only 1 byte- Throws:
IOException
-
readByteLE
public byte readByteLE() throws IOException
read a byte in LittleEndian - the same as BE because its only 1 byte- Throws:
IOException
-
readByteLEnum
public void readByteLEnum(byte[] b) throws IOException
read a byte in LittleEndian - the same as BE because its only 1 byte- Throws:
IOException
-
readUnsignedByteBE
public int readUnsignedByteBE() throws IOException
read a byte in BigEndian - the same as LE because its only 1 byte. returns int as per java.io.DataStream- Throws:
IOException
-
readUnsignedByteLE
public int readUnsignedByteLE() throws IOException
read a byte in LittleEndian - the same as BE because its only 1 byte. returns int as per java.io.DataStream- Throws:
IOException
-
readShortBE
public short readShortBE() throws IOException
read a 16bit short in BE- Throws:
IOException
-
readShortLE
public short readShortLE() throws IOException
read a 16bit short in LE- Throws:
IOException
-
readIntBE
public int readIntBE() throws IOException
read a 32bit int in BE- Throws:
IOException
-
readIntLE
public int readIntLE() throws IOException
read a 32bit int in LE- Throws:
IOException
-
readLongBE
public long readLongBE() throws IOException
read a 64bit long in BE- Throws:
IOException
-
readLongLE
public long readLongLE() throws IOException
read a 64bit long in LE- Throws:
IOException
-
readDoubleBE
public double readDoubleBE() throws IOException
read a 64bit double in BE- Throws:
IOException
-
readDoubleLE
public double readDoubleLE() throws IOException
read a 64bit double in LE- Throws:
IOException
-
skipBytes
public int skipBytes(int num) throws IOException
skip ahead in the stream- Parameters:
num
- number of bytes to read ahead- Throws:
IOException
-
-