Package dev.latvian.mods.klib.io
Record Class ByteInput.OfBuffer
java.lang.Object
java.lang.Record
dev.latvian.mods.klib.io.ByteInput.OfBuffer
- All Implemented Interfaces:
ByteInput
- Enclosing interface:
ByteInput
public static record ByteInput.OfBuffer(ByteBuffer in, int startingPosition)
extends Record
implements ByteInput
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.latvian.mods.klib.io.ByteInput
ByteInput.OfBuffer, ByteInput.OfData, ByteInput.OfStream -
Constructor Summary
ConstructorsConstructorDescriptionOfBuffer(ByteBuffer in, int startingPosition) Creates an instance of aOfBufferrecord 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.in()Returns the value of theinrecord component.byte[]readAll()intreadAll(byte[] buffer, int offset, int len) bytereadByte()doublefloatintreadInt()longreadLong()intreadRaw()shortintvoidskip(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.ByteInput
readAll, readBoolean, readByteArray, readExactTime, readNullableExactTime, readNullableUUID, readUByte, readUTF, readUUID, readVarInt, readVarLong
-
Constructor Details
-
OfBuffer
Creates an instance of aOfBufferrecord class.- Parameters:
in- the value for theinrecord componentstartingPosition- the value for thestartingPositionrecord component
-
-
Method Details
-
readRaw
public int readRaw() -
skip
- Specified by:
skipin interfaceByteInput- Throws:
IOException
-
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
-
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
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
-