Record Class ByteBufByteInput

java.lang.Object
java.lang.Record
dev.latvian.mods.klib.io.bytes.ByteBufByteInput
All Implemented Interfaces:
ByteInput

public record ByteBufByteInput(io.netty.buffer.ByteBuf in, int startingPosition) extends Record implements ByteInput
  • Constructor Details

    • ByteBufByteInput

      public ByteBufByteInput(io.netty.buffer.ByteBuf in, int startingPosition)
      Creates an instance of a ByteBufByteInput record class.
      Parameters:
      in - the value for the in record component
      startingPosition - the value for the startingPosition record component
  • Method Details

    • of

      public static ByteBufByteInput of(io.netty.buffer.ByteBuf in)
    • readRaw

      public int readRaw()
      Specified by:
      readRaw in interface ByteInput
    • skip

      public void skip(long skip)
      Specified by:
      skip in interface ByteInput
    • readByte

      public byte readByte()
      Specified by:
      readByte in interface ByteInput
    • readAll

      public int readAll(byte[] buffer, int offset, int len)
      Specified by:
      readAll in interface ByteInput
    • readAll

      public byte[] readAll()
      Specified by:
      readAll in interface ByteInput
    • readShort

      public short readShort()
      Specified by:
      readShort in interface ByteInput
    • readUShort

      public int readUShort()
      Specified by:
      readUShort in interface ByteInput
    • readInt

      public int readInt()
      Specified by:
      readInt in interface ByteInput
    • readLong

      public long readLong()
      Specified by:
      readLong in interface ByteInput
    • readFloat

      public float readFloat()
      Specified by:
      readFloat in interface ByteInput
    • readDouble

      public double readDouble()
      Specified by:
      readDouble in interface ByteInput
    • readVarInt

      public int readVarInt()
      Specified by:
      readVarInt in interface ByteInput
    • readVarLong

      public long readVarLong()
      Specified by:
      readVarLong in interface ByteInput
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • in

      public io.netty.buffer.ByteBuf in()
      Returns the value of the in record component.
      Returns:
      the value of the in record component
    • startingPosition

      public int startingPosition()
      Returns the value of the startingPosition record component.
      Returns:
      the value of the startingPosition record component