Documentation of 'org.freehep.util.io.ByteOrderInputStream' Java class
ByteOrderInputStream
org.freehep.util.io

Class ByteOrderInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.io.DataInput, java.lang.AutoCloseable
    Direct Known Subclasses:
    ByteCountInputStream


    public class ByteOrderInputStream
    extends BitInputStream
    implements java.io.DataInput
    Class to read bytes and pairs of bytes in both little and big endian order.
    • Constructor Detail

      • ByteOrderInputStream

        public ByteOrderInputStream(java.io.InputStream in)
        Create a byte order (big-endian) input stream from given stream.
        Parameters:
        in - stream to read from
      • ByteOrderInputStream

        public ByteOrderInputStream(java.io.InputStream in,
                                    boolean littleEndian)
        Create a byte order input stream from given stream.
        Parameters:
        in - stream to read from
        littleEndian - true if stream should be little endian.
    • Method Detail

      • readFully

        public void readFully(byte[] b)
                       throws java.io.IOException
        Specified by:
        readFully in interface java.io.DataInput
        Throws:
        java.io.IOException
      • readFully

        public void readFully(byte[] b,
                              int off,
                              int len)
                       throws java.io.IOException
        Specified by:
        readFully in interface java.io.DataInput
        Throws:
        java.io.IOException
      • skipBytes

        public int skipBytes(int n)
                      throws java.io.IOException
        Specified by:
        skipBytes in interface java.io.DataInput
        Throws:
        java.io.IOException
      • readBoolean

        public boolean readBoolean()
                            throws java.io.IOException
        Specified by:
        readBoolean in interface java.io.DataInput
        Throws:
        java.io.IOException
      • readChar

        public char readChar()
                      throws java.io.IOException
        Specified by:
        readChar in interface java.io.DataInput
        Throws:
        java.io.IOException
      • readByte

        public byte readByte()
                      throws java.io.IOException
        Read a signed byte.
        Specified by:
        readByte in interface java.io.DataInput
        Throws:
        java.io.IOException
      • readByte

        public byte[] readByte(int n)
                        throws java.io.IOException
        Read n bytes and return in byte array.
        Parameters:
        n - number of bytes to read
        Returns:
        byte array
        Throws:
        java.io.IOException - if read fails
      • readUnsignedByte

        public int readUnsignedByte()
                             throws java.io.IOException
        Read an unsigned byte.
        Specified by:
        readUnsignedByte in interface java.io.DataInput
        Throws:
        java.io.IOException
      • readUnsignedByte

        public int[] readUnsignedByte(int n)
                               throws java.io.IOException
        Read n unsigned bytes and return in int array.
        Parameters:
        n - number of bytes to read
        Returns:
        int array
        Throws:
        java.io.IOException - if read fails
      • readShort

        public short readShort()
                        throws java.io.IOException
        Read a signed short.
        Specified by:
        readShort in interface java.io.DataInput
        Throws:
        java.io.IOException
      • readShort

        public short[] readShort(int n)
                          throws java.io.IOException
        Read n shorts and return in short array
        Parameters:
        n - number of shorts to read
        Returns:
        short array
        Throws:
        java.io.IOException - if read fails
      • readUnsignedShort

        public int readUnsignedShort()
                              throws java.io.IOException
        Read an unsigned short.
        Specified by:
        readUnsignedShort in interface java.io.DataInput
        Throws:
        java.io.IOException
      • readUnsignedShort

        public int[] readUnsignedShort(int n)
                                throws java.io.IOException
        Read n unsigned shorts and return in int array
        Parameters:
        n - number of shorts to read
        Returns:
        int array
        Throws:
        java.io.IOException - if read fails
      • readInt

        public int readInt()
                    throws java.io.IOException
        Read a signed integer.
        Specified by:
        readInt in interface java.io.DataInput
        Throws:
        java.io.IOException
      • readInt

        public int[] readInt(int n)
                      throws java.io.IOException
        Read n ints and return in int array.
        Parameters:
        n - number of ints to read
        Returns:
        int array
        Throws:
        java.io.IOException - if read fails
      • readUnsignedInt

        public long readUnsignedInt()
                             throws java.io.IOException
        Read an unsigned integer.
        Returns:
        long
        Throws:
        java.io.IOException - if read fails
      • readUnsignedInt

        public long[] readUnsignedInt(int n)
                               throws java.io.IOException
        Read n unsigned ints and return in long array.
        Parameters:
        n - number of ints to read
        Returns:
        long array
        Throws:
        java.io.IOException - if read fails
      • readLong

        public long readLong()
                      throws java.io.IOException
        Specified by:
        readLong in interface java.io.DataInput
        Throws:
        java.io.IOException
      • readFloat

        public float readFloat()
                        throws java.io.IOException
        Specified by:
        readFloat in interface java.io.DataInput
        Throws:
        java.io.IOException
      • readDouble

        public double readDouble()
                          throws java.io.IOException
        Specified by:
        readDouble in interface java.io.DataInput
        Throws:
        java.io.IOException
      • readLine

        public java.lang.String readLine()
                                  throws java.io.IOException
        Deprecated. 
        Specified by:
        readLine in interface java.io.DataInput
        Throws:
        java.io.IOException
      • readString

        public java.lang.String readString()
                                    throws java.io.IOException
        Read a string (UTF).
        Returns:
        string
        Throws:
        java.io.IOException - if read fails
      • readUTF

        public java.lang.String readUTF()
                                 throws java.io.IOException
        Specified by:
        readUTF in interface java.io.DataInput
        Throws:
        java.io.IOException
      • readAsciiZString

        public java.lang.String readAsciiZString()
                                          throws java.io.IOException
        Read an ascii-z (0 terminated c-string).
        Returns:
        string
        Throws:
        java.io.IOException - if read fails

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.