Class EndianDataInputStream

java.lang.Object
org.locationtech.jtstest.testbuilder.io.shapefile.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 Details

    • EndianDataInputStream

      public EndianDataInputStream(InputStream in)
      Creates new EndianDataInputStream
  • Method Details

    • 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