Package dev.latvian.mods.klib.io.bytes
Record Class ByteBufByteInput
java.lang.Object
java.lang.Record
dev.latvian.mods.klib.io.bytes.ByteBufByteInput
- All Implemented Interfaces:
ByteInput
-
Constructor Summary
ConstructorsConstructorDescriptionByteBufByteInput(io.netty.buffer.ByteBuf in, int startingPosition) Creates an instance of aByteBufByteInputrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.io.netty.buffer.ByteBufin()Returns the value of theinrecord component.static ByteBufByteInputof(io.netty.buffer.ByteBuf in) byte[]readAll()intreadAll(byte[] buffer, int offset, int len) bytereadByte()doublefloatintreadInt()longreadLong()intreadRaw()shortintintlongvoidskip(long skip) intReturns the value of thestartingPositionrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.latvian.mods.klib.io.bytes.ByteInput
readAll, readBoolean, readByteArray, readExactTime, readNullableExactTime, readNullableUUID, readUByte, readUTF, readUUID
-
Constructor Details
-
ByteBufByteInput
public ByteBufByteInput(io.netty.buffer.ByteBuf in, int startingPosition) Creates an instance of aByteBufByteInputrecord class.- Parameters:
in- the value for theinrecord componentstartingPosition- the value for thestartingPositionrecord component
-
-
Method Details
-
of
-
readRaw
public int readRaw() -
skip
public void skip(long skip) -
readByte
public byte readByte() -
readAll
public int readAll(byte[] buffer, int offset, int len) -
readAll
public byte[] readAll() -
readShort
public short readShort() -
readUShort
public int readUShort()- Specified by:
readUShortin interfaceByteInput
-
readInt
public int readInt() -
readLong
public long readLong() -
readFloat
public float readFloat() -
readDouble
public double readDouble()- Specified by:
readDoublein interfaceByteInput
-
readVarInt
public int readVarInt()- Specified by:
readVarIntin interfaceByteInput
-
readVarLong
public long readVarLong()- Specified by:
readVarLongin interfaceByteInput
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
in
public io.netty.buffer.ByteBuf in()Returns the value of theinrecord component.- Returns:
- the value of the
inrecord component
-
startingPosition
public int startingPosition()Returns the value of thestartingPositionrecord component.- Returns:
- the value of the
startingPositionrecord component
-