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 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.voidreadAll(byte[] buffer) voidreadAll(byte[] buffer, int offset, int len) bytereadByte()doublefloatintreadInt()longreadLong()shortintintReturns the value of thestartingPositionrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface ByteInput
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
-
readByte
-
readAll
-
readAll
-
readShort
-
readUShort
public int readUShort()- Specified by:
readUShortin interfaceByteInput
-
readInt
-
readLong
-
readFloat
-
readDouble
public double readDouble()- Specified by:
readDoublein interfaceByteInput
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
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
-