Package dev.latvian.mods.klib.io
Record Class ByteOutput.OfBuffer
java.lang.Object
java.lang.Record
dev.latvian.mods.klib.io.ByteOutput.OfBuffer
- All Implemented Interfaces:
ByteOutput
- Enclosing interface:
ByteOutput
public static record ByteOutput.OfBuffer(ByteBuffer out, int startingPosition)
extends Record
implements ByteOutput
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.latvian.mods.klib.io.ByteOutput
ByteOutput.OfBuffer, ByteOutput.OfData, ByteOutput.OfStream -
Constructor Summary
ConstructorsConstructorDescriptionOfBuffer(ByteBuffer out, 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.out()Returns the value of theoutrecord component.intReturns the value of thestartingPositionrecord component.byte[]final StringtoString()Returns a string representation of this record class.voidwriteAll(byte[] value) voidwriteAll(byte[] value, int offset, int len) voidwriteByte(byte value) voidwriteDouble(double value) voidwriteFloat(float value) voidwriteInt(int value) voidwriteLong(long value) voidwriteShort(short value) voidwriteUShort(int value) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.latvian.mods.klib.io.ByteOutput
flush, writeByteArray, writeExactTime, writeUByte, writeUTF, writeUUID, writeVarInt, writeVarLong
-
Constructor Details
-
OfBuffer
Creates an instance of aOfBufferrecord class.- Parameters:
out- the value for theoutrecord componentstartingPosition- the value for thestartingPositionrecord component
-
-
Method Details
-
writeByte
public void writeByte(byte value) - Specified by:
writeBytein interfaceByteOutput
-
writeAll
public void writeAll(byte[] value, int offset, int len) - Specified by:
writeAllin interfaceByteOutput
-
writeAll
public void writeAll(byte[] value) - Specified by:
writeAllin interfaceByteOutput
-
writeShort
public void writeShort(short value) - Specified by:
writeShortin interfaceByteOutput
-
writeUShort
public void writeUShort(int value) - Specified by:
writeUShortin interfaceByteOutput
-
writeInt
public void writeInt(int value) - Specified by:
writeIntin interfaceByteOutput
-
writeLong
public void writeLong(long value) - Specified by:
writeLongin interfaceByteOutput
-
writeFloat
public void writeFloat(float value) - Specified by:
writeFloatin interfaceByteOutput
-
writeDouble
public void writeDouble(double value) - Specified by:
writeDoublein interfaceByteOutput
-
toByteArray
- Specified by:
toByteArrayin interfaceByteOutput- Throws:
IOException
-
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 '=='. -
out
Returns the value of theoutrecord component.- Returns:
- the value of the
outrecord component
-
startingPosition
public int startingPosition()Returns the value of thestartingPositionrecord component.- Returns:
- the value of the
startingPositionrecord component
-