Interface BinaryReader

All Known Implementing Classes:
SegmentBinaryReader

public interface BinaryReader
An interface for reading binary data sequentially from an underlying source. This provides a high-level abstraction for zero-copy decoding operations.
  • Method Details

    • position

      long position()
      Gets the current read offset in bytes.
    • position

      void position(long newPosition)
      Sets the current read offset in bytes.
    • skip

      void skip(long bytesToSkip)
      Skips a specified number of bytes.
    • remaining

      long remaining()
      Gets the number of remaining readable bytes.
    • readByte

      byte readByte()
    • readShortBE

      short readShortBE()
    • readIntBE

      int readIntBE()
    • readLongBE

      long readLongBE()
    • readFloatBE

      float readFloatBE()
    • readDoubleBE

      double readDoubleBE()
    • readBoolean

      boolean readBoolean()
    • readShortLE

      short readShortLE()
    • readIntLE

      int readIntLE()
    • readLongLE

      long readLongLE()
    • readFloatLE

      float readFloatLE()
    • readDoubleLE

      double readDoubleLE()
    • readVarInt

      int readVarInt()
      Reads a variable-length 32-bit integer (efficient for small numbers).
    • readVarLong

      long readVarLong()
      Reads a variable-length 64-bit integer (efficient for small numbers).
    • readString

      void readString(Utf8View viewToPopulate)
    • readBytes

      byte[] readBytes()
    • readNullableByte

      Byte readNullableByte()
    • readNullableShortBE

      Short readNullableShortBE()
    • readNullableIntBE

      Integer readNullableIntBE()
    • readNullableLongBE

      Long readNullableLongBE()
    • readNullableShortLE

      Short readNullableShortLE()
    • readNullableIntLE

      Integer readNullableIntLE()
    • readNullableLongLE

      Long readNullableLongLE()
    • readNullableFloatLE

      Float readNullableFloatLE()
    • readNullableDoubleLE

      Double readNullableDoubleLE()
    • readNullableString

      boolean readNullableString(Utf8View viewToPopulate)
    • readNullableBytes

      byte[] readNullableBytes()
    • readSegment

      MemorySegment readSegment(long length)
      Reads a slice of the underlying data without copying it to the heap. This is a highly efficient way to process a sub-section of the data.
      Parameters:
      length - The number of bytes in the slice.
      Returns:
      A MemorySegment view of the requested data.