Package io.aether.utils.dataio
Class DataInOutStatic
- java.lang.Object
-
- io.aether.utils.dataio.DataInOutStatic
-
-
Constructor Summary
Constructors Constructor Description DataInOutStatic(byte[] ar)DataInOutStatic(byte[] ar, int readPos, int writePos)DataInOutStatic(int initSize)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clears this output stream.byte[]getData()intgetReadPos()intgetSizeForRead()Returns the size of the data that can be read from this input stream, in bytes.intgetSizeForWrite()Returns the size of this output stream for writing, in bytes.intgetWritePos()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.booleanisWritable()Returns whether this output stream is writable or not.static DataInOutStaticofBytes(java.lang.String s)intread(byte[] b, int offset, int len)Reads a byte array from this input stream and returns the number of bytes actually read.intreadInt()Returns the next int value from this input stream, casting it to an int value in the range -2147483648 to 2147483647.longreadLong()Returns the next long value from this input stream, casting it to a long value in the range -9223372036854775808 to 9223372036854775807.intreadUByte()Returns the next byte of data from this input stream, casting it to an unsigned byte value in the range 0-255.voidsetReadPos(int readPos)voidsetWritePos(int writePos)voidskipBytes(int n)Skips the specified number of bytes in this input stream.byte[]toArray()Returns a copy of this input stream as an array of bytes.java.lang.StringtoString()inttotal()voidwrite(byte @NotNull [] b)Writes a byte array to this output stream and returns the number of bytes actually written.intwrite(byte @NotNull [] b, int off, int len)Writes a byte array to this output stream and returns the number of bytes actually written.voidwriteByte(int v)Writes a byte value to this output stream.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.aether.utils.dataio.DataIn
isEmpty, isReadable, read, read, read, readBoolean, readByte, readBytes, readChar, readDouble, readFloat, readShort, readString1, readSubData, readUInt, readUShort, skipAllBytes
-
Methods inherited from interface io.aether.utils.dataio.DataOut
write, write, write, write, write, writeBoolean, writeChar, writeDouble, writeFloat, writeHexBytes, writeInt, writeLong, writeShort, writeShort
-
-
-
-
Method Detail
-
skipBytes
public void skipBytes(int n)
Description copied from interface:DataInSkips the specified number of bytes in this input stream.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getData
public byte[] getData()
-
getReadPos
public int getReadPos()
-
setReadPos
public void setReadPos(int readPos)
-
getWritePos
public int getWritePos()
-
setWritePos
public void setWritePos(int writePos)
-
getSizeForWrite
public int getSizeForWrite()
Description copied from interface:DataOutReturns the size of this output stream for writing, in bytes.- Specified by:
getSizeForWritein interfaceDataOut
-
isWritable
public boolean isWritable()
Description copied from interface:DataOutReturns whether this output stream is writable or not.- Specified by:
isWritablein interfaceDataOut
-
clear
public void clear()
Description copied from interface:DataOutClears this output stream.
-
getSizeForRead
public int getSizeForRead()
Description copied from interface:DataInReturns the size of the data that can be read from this input stream, in bytes.- Specified by:
getSizeForReadin interfaceDataIn
-
read
public int read(byte[] b, int offset, int len)Description copied from interface:DataInReads a byte array from this input stream and returns the number of bytes actually read.
-
write
public void write(byte @NotNull [] b)
Description copied from interface:DataOutWrites a byte array to this output stream and returns the number of bytes actually written.
-
write
public int write(byte @NotNull [] b, int off, int len)Description copied from interface:DataOutWrites a byte array to this output stream and returns the number of bytes actually written.
-
readInt
public int readInt()
Description copied from interface:DataInReturns the next int value from this input stream, casting it to an int value in the range -2147483648 to 2147483647.
-
readLong
public long readLong()
Description copied from interface:DataInReturns the next long value from this input stream, casting it to a long value in the range -9223372036854775808 to 9223372036854775807.
-
readUByte
public int readUByte()
Description copied from interface:DataInReturns the next byte of data from this input stream, casting it to an unsigned byte value in the range 0-255.
-
toArray
public byte[] toArray()
Description copied from interface:DataInReturns a copy of this input stream as an array of bytes.
-
indexOf
public int indexOf(int limit, byte val)Description copied from interface:DataInReturns the index within this input stream of the first occurrence of the specified byte, or -1 if no such byte exists.
-
writeByte
public void writeByte(int v)
Description copied from interface:DataOutWrites a byte value to this output stream.
-
total
public int total()
-
ofBytes
public static DataInOutStatic ofBytes(java.lang.String s)
-
-