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
  • Constructor Details

    • OfBuffer

      public OfBuffer(ByteBuffer in, int startingPosition)
      Creates an instance of a OfBuffer record class.
      Parameters:
      in - the value for the in record component
      startingPosition - the value for the startingPosition record component
  • Method Details

    • readByte

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

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

      public void readAll(byte[] buffer)
      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
    • 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 ByteBuffer 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