Package dev.latvian.mods.klib.io.bytes
Record Class ByteBufByteOutput
java.lang.Object
java.lang.Record
dev.latvian.mods.klib.io.bytes.ByteBufByteOutput
- All Implemented Interfaces:
ByteOutput
public record ByteBufByteOutput(io.netty.buffer.ByteBuf out, int startingPosition)
extends Record
implements ByteOutput
-
Constructor Summary
ConstructorsConstructorDescriptionByteBufByteOutput(io.netty.buffer.ByteBuf out, int startingPosition) Creates an instance of aByteBufByteOutputrecord 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.static ByteBufByteOutputof(io.netty.buffer.ByteBuf buf) io.netty.buffer.ByteBufout()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) voidwriteUByte(int value) voidwriteUShort(int value) voidwriteVarInt(int value) voidwriteVarLong(long value) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.latvian.mods.klib.io.bytes.ByteOutput
flush, writeByteArray, writeExactTime, writeUTF, writeUUID
-
Constructor Details
-
ByteBufByteOutput
public ByteBufByteOutput(io.netty.buffer.ByteBuf out, int startingPosition) Creates an instance of aByteBufByteOutputrecord class.- Parameters:
out- the value for theoutrecord componentstartingPosition- the value for thestartingPositionrecord component
-
-
Method Details
-
of
-
writeByte
- Specified by:
writeBytein interfaceByteOutput- Throws:
IOException
-
writeUByte
public void writeUByte(int value) - Specified by:
writeUBytein 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
-
writeVarInt
public void writeVarInt(int value) - Specified by:
writeVarIntin interfaceByteOutput
-
writeVarLong
public void writeVarLong(long value) - Specified by:
writeVarLongin 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
public io.netty.buffer.ByteBuf 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
-