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 voidclose()close the streambytereadByteBE()read a byte in BigEndian - the same as LE because its only 1 bytebytereadByteLE()read a byte in LittleEndian - the same as BE because its only 1 bytevoidreadByteLEnum(byte[] b)read a byte in LittleEndian - the same as BE because its only 1 bytedoublereadDoubleBE()read a 64bit double in BEdoublereadDoubleLE()read a 64bit double in LEintreadIntBE()read a 32bit int in BEintreadIntLE()read a 32bit int in LElongreadLongBE()read a 64bit long in BElongreadLongLE()read a 64bit long in LEshortreadShortBE()read a 16bit short in BEshortreadShortLE()read a 16bit short in LEintreadUnsignedByteBE()read a byte in BigEndian - the same as LE because its only 1 byte.intreadUnsignedByteLE()read a byte in LittleEndian - the same as BE because its only 1 byte.intskipBytes(int num)skip ahead in the stream
-
-
-
Constructor Detail
-
EndianDataInputStream
public EndianDataInputStream(InputStream in)
Creates new EndianDataInputStream
-
-
Method Detail
-
close
public void close() throws IOExceptionclose the stream- Throws:
IOException
-
readByteBE
public byte readByteBE() throws IOExceptionread a byte in BigEndian - the same as LE because its only 1 byte- Throws:
IOException
-
readByteLE
public byte readByteLE() throws IOExceptionread a byte in LittleEndian - the same as BE because its only 1 byte- Throws:
IOException
-
readByteLEnum
public void readByteLEnum(byte[] b) throws IOExceptionread a byte in LittleEndian - the same as BE because its only 1 byte- Throws:
IOException
-
readUnsignedByteBE
public int readUnsignedByteBE() throws IOExceptionread 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 IOExceptionread 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 IOExceptionread a 16bit short in BE- Throws:
IOException
-
readShortLE
public short readShortLE() throws IOExceptionread a 16bit short in LE- Throws:
IOException
-
readIntBE
public int readIntBE() throws IOExceptionread a 32bit int in BE- Throws:
IOException
-
readIntLE
public int readIntLE() throws IOExceptionread a 32bit int in LE- Throws:
IOException
-
readLongBE
public long readLongBE() throws IOExceptionread a 64bit long in BE- Throws:
IOException
-
readLongLE
public long readLongLE() throws IOExceptionread a 64bit long in LE- Throws:
IOException
-
readDoubleBE
public double readDoubleBE() throws IOExceptionread a 64bit double in BE- Throws:
IOException
-
readDoubleLE
public double readDoubleLE() throws IOExceptionread a 64bit double in LE- Throws:
IOException
-
skipBytes
public int skipBytes(int num) throws IOExceptionskip ahead in the stream- Parameters:
num- number of bytes to read ahead- Throws:
IOException
-
-