Class 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 Detail

      • EndianDataInputStream

        public EndianDataInputStream​(InputStream in)
        Creates new EndianDataInputStream
    • Method Detail

      • 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
      • 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