Class EndianDataInputStream
java.lang.Object
org.locationtech.jtstest.testbuilder.io.shapefile.EndianDataInputStream
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.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
close the streambyte
read a byte in BigEndian - the same as LE because its only 1 bytebyte
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
read a 64bit double in BEdouble
read a 64bit double in LEint
read a 32bit int in BEint
read a 32bit int in LElong
read a 64bit long in BElong
read a 64bit long in LEshort
read a 16bit short in BEshort
read a 16bit short in LEint
read a byte in BigEndian - the same as LE because its only 1 byte.int
read a byte in LittleEndian - the same as BE because its only 1 byte.int
skipBytes
(int num) skip ahead in the stream
-
Field Details
-
inputStream
-
workSpace
private byte[] workSpace
-
-
Constructor Details
-
EndianDataInputStream
Creates new EndianDataInputStream
-
-
Method Details
-
close
close the stream- Throws:
IOException
-
readByteBE
read a byte in BigEndian - the same as LE because its only 1 byte- Throws:
IOException
-
readByteLE
read a byte in LittleEndian - the same as BE because its only 1 byte- Throws:
IOException
-
readByteLEnum
read a byte in LittleEndian - the same as BE because its only 1 byte- Throws:
IOException
-
readUnsignedByteBE
read a byte in BigEndian - the same as LE because its only 1 byte. returns int as per java.io.DataStream- Throws:
IOException
-
readUnsignedByteLE
read a byte in LittleEndian - the same as BE because its only 1 byte. returns int as per java.io.DataStream- Throws:
IOException
-
readShortBE
read a 16bit short in BE- Throws:
IOException
-
readShortLE
read a 16bit short in LE- Throws:
IOException
-
readIntBE
read a 32bit int in BE- Throws:
IOException
-
readIntLE
read a 32bit int in LE- Throws:
IOException
-
readLongBE
read a 64bit long in BE- Throws:
IOException
-
readLongLE
read a 64bit long in LE- Throws:
IOException
-
readDoubleBE
read a 64bit double in BE- Throws:
IOException
-
readDoubleLE
read a 64bit double in LE- Throws:
IOException
-
skipBytes
skip ahead in the stream- Parameters:
num
- number of bytes to read ahead- Throws:
IOException
-