Interface DataIn

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      int getSizeForRead()
      Returns the size of the data that can be read from this input stream, in bytes.
      int indexOf​(int limit, byte val)
      Returns the index within this input stream of the first occurrence of the specified byte, or -1 if no such byte exists.
      default boolean isEmpty()
      Returns true if this input stream is empty, false otherwise.
      default boolean isReadable()
      Returns true if this input stream is readable, false otherwise.
      default int read​(byte[] b)
      Reads a byte array from this input stream and returns the number of bytes actually read.
      default int read​(byte[] b, int offset, int len)
      Reads a byte array from this input stream and returns the number of bytes actually read.
      default int read​(int[] b)
      Reads an integer array from this input stream and returns the number of integers actually read.
      default int read​(int[] b, int offset, int len)
      Reads an integer array from this input stream and returns the number of integers actually read.
      default boolean readBoolean()
      Reads a byte from this input stream and returns it as an integer.
      default byte readByte()
      Reads a byte from this input stream and returns it as a byte value.
      default byte[] readBytes​(int len)  
      default char readChar()
      Returns the next character value from this input stream, casting it to a char value in the range '' to '
      default double readDouble()
      Returns the next double value from this input stream, casting it to a double value in the range -1.7976931348623157E+308D to 1.7976931348623157E+308D.
      default float readFloat()
      Returns the next float value from this input stream, casting it to a float value in the range -3.4028235E+38F to 3.4028235E+38F.
      default int readInt()
      Returns the next int value from this input stream, casting it to an int value in the range -2147483648 to 2147483647.
      default long readLong()
      Returns the next long value from this input stream, casting it to a long value in the range -9223372036854775808 to 9223372036854775807.
      default short readShort()
      Returns the next short value from this input stream, casting it to a short value in the range -32768 to 32767.
      default java.lang.String readString1()
      Reads a string from this input stream and returns it.
      default DataIO readSubData​(int length)
      Reads a subarray of bytes from this input stream and returns the number of bytes actually read.
      int readUByte()
      Returns the next byte of data from this input stream, casting it to an unsigned byte value in the range 0-255.
      default long readUInt()
      Returns the next long value from this input stream, casting it to a long value in the range -9223372036854775808 to 9223372036854775807.
      default int readUShort()
      Returns the next unsigned short value from this input stream, casting it to an int value in the range 0-65535.
      default void skipAllBytes()
      Skips all bytes in this input stream.
      default void skipBytes​(int n)
      Skips the specified number of bytes in this input stream.
      default byte[] toArray()
      Returns a copy of this input stream as an array of bytes.
    • Method Detail

      • getSizeForRead

        int getSizeForRead()
        Returns the size of the data that can be read from this input stream, in bytes.
      • read

        default int read​(byte[] b)
        Reads a byte array from this input stream and returns the number of bytes actually read.
        Parameters:
        b - The byte array to read into.
        Returns:
        The number of bytes actually read.
      • read

        default int read​(int[] b)
        Reads an integer array from this input stream and returns the number of integers actually read.
        Parameters:
        b - The integer array to read into.
        Returns:
        The number of integers actually read.
      • read

        default int read​(byte[] b,
                         int offset,
                         int len)
        Reads a byte array from this input stream and returns the number of bytes actually read.
        Parameters:
        b - The byte array to read into.
        offset - The starting position in the array to write to.
        len - The maximum number of bytes to read.
        Returns:
        The number of bytes actually read.
      • read

        default int read​(int[] b,
                         int offset,
                         int len)
        Reads an integer array from this input stream and returns the number of integers actually read.
        Parameters:
        b - The integer array to read into.
        offset - The starting position in the array to write to.
        len - The maximum number of integers to read.
        Returns:
        The number of integers actually read.
      • isEmpty

        default boolean isEmpty()
        Returns true if this input stream is empty, false otherwise.
      • skipBytes

        default void skipBytes​(int n)
        Skips the specified number of bytes in this input stream.
        Parameters:
        n - The number of bytes to skip.
      • isReadable

        default boolean isReadable()
        Returns true if this input stream is readable, false otherwise.
      • readBoolean

        default boolean readBoolean()
        Reads a byte from this input stream and returns it as an integer.
      • readByte

        default byte readByte()
        Reads a byte from this input stream and returns it as a byte value.
      • readUByte

        int readUByte()
        Returns the next byte of data from this input stream, casting it to an unsigned byte value in the range 0-255.
      • readSubData

        default DataIO readSubData​(int length)
        Reads a subarray of bytes from this input stream and returns the number of bytes actually read.
        Parameters:
        length - The maximum number of bytes to read.
      • readShort

        default short readShort()
        Returns the next short value from this input stream, casting it to a short value in the range -32768 to 32767.
      • readUShort

        default int readUShort()
        Returns the next unsigned short value from this input stream, casting it to an int value in the range 0-65535.
      • readChar

        default char readChar()
        Returns the next character value from this input stream, casting it to a char value in the range '' to '￿'.
      • readInt

        default int readInt()
        Returns the next int value from this input stream, casting it to an int value in the range -2147483648 to 2147483647.
      • readUInt

        default long readUInt()
        Returns the next long value from this input stream, casting it to a long value in the range -9223372036854775808 to 9223372036854775807.
      • readLong

        default long readLong()
        Returns the next long value from this input stream, casting it to a long value in the range -9223372036854775808 to 9223372036854775807.
      • readFloat

        default float readFloat()
        Returns the next float value from this input stream, casting it to a float value in the range -3.4028235E+38F to 3.4028235E+38F.
      • readDouble

        default double readDouble()
        Returns the next double value from this input stream, casting it to a double value in the range -1.7976931348623157E+308D to 1.7976931348623157E+308D.
      • readString1

        default java.lang.String readString1()
        Reads a string from this input stream and returns it.
      • toArray

        default byte[] toArray()
        Returns a copy of this input stream as an array of bytes.
      • skipAllBytes

        default void skipAllBytes()
        Skips all bytes in this input stream.
      • indexOf

        int indexOf​(int limit,
                    byte val)
        Returns the index within this input stream of the first occurrence of the specified byte, or -1 if no such byte exists.
      • readBytes

        default byte[] readBytes​(int len)