Package io.aether.utils.dataio
Interface DataIn
-
- All Known Subinterfaces:
DataIO
- All Known Implementing Classes:
ByteBufferDataIO,DataInOut,DataInOutStatic
public interface DataIn
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description intgetSizeForRead()Returns the size of the data that can be read from this input stream, in bytes.intindexOf(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 booleanisEmpty()Returns true if this input stream is empty, false otherwise.default booleanisReadable()Returns true if this input stream is readable, false otherwise.default intread(byte[] b)Reads a byte array from this input stream and returns the number of bytes actually read.default intread(byte[] b, int offset, int len)Reads a byte array from this input stream and returns the number of bytes actually read.default intread(int[] b)Reads an integer array from this input stream and returns the number of integers actually read.default intread(int[] b, int offset, int len)Reads an integer array from this input stream and returns the number of integers actually read.default booleanreadBoolean()Reads a byte from this input stream and returns it as an integer.default bytereadByte()Reads a byte from this input stream and returns it as a byte value.default byte[]readBytes(int len)default charreadChar()Returns the next character value from this input stream, casting it to a char value in the range ' ' to 'default doublereadDouble()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 floatreadFloat()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 intreadInt()Returns the next int value from this input stream, casting it to an int value in the range -2147483648 to 2147483647.default longreadLong()Returns the next long value from this input stream, casting it to a long value in the range -9223372036854775808 to 9223372036854775807.default shortreadShort()Returns the next short value from this input stream, casting it to a short value in the range -32768 to 32767.default java.lang.StringreadString1()Reads a string from this input stream and returns it.default DataIOreadSubData(int length)Reads a subarray of bytes from this input stream and returns the number of bytes actually read.intreadUByte()Returns the next byte of data from this input stream, casting it to an unsigned byte value in the range 0-255.default longreadUInt()Returns the next long value from this input stream, casting it to a long value in the range -9223372036854775808 to 9223372036854775807.default intreadUShort()Returns the next unsigned short value from this input stream, casting it to an int value in the range 0-65535.default voidskipAllBytes()Skips all bytes in this input stream.default voidskipBytes(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)
-
-