Table of Contents

Public classSealed IndexOutput

Namespace
Rowles.LeanLucene.Store
Assembly
Rowles.LeanLucene.dll

Buffered sequential writer backed by System.IO.FileStream and System.Buffers.ArrayPool`1. Used at index-build time only.

public sealed class IndexOutput : IDisposable
IndexOutput

Constructors

Public constructor IndexOutput(string, bool)

Creates a new file at filePath and opens it for buffered sequential writing.

Properties

Public propertyRead-only Position

Current logical write position (buffered + flushed).

Methods

Public method Dispose()

Flushes remaining buffered data and releases all resources.

Public method Flush()

Flushes the internal write buffer to the underlying file stream.

Public method Seek(long)

Seeks to an absolute position. Flushes the buffer first to ensure consistency. Use sparingly — this forces a buffer flush.

Public method WriteBoolean(bool)

Writes a boolean as a single byte (0 or 1).

Public method WriteByte(byte)

Writes a single byte to the output, flushing the buffer if it is full.

Public method WriteBytes(byte[])

Writes all bytes from the given array to the output.

Public method WriteBytes(ReadOnlySpan<byte>)

Writes the bytes from the given span to the output, flushing the internal buffer as needed.

Public method WriteInt32(int)

Writes a 32-bit signed integer in little-endian byte order.

Public method WriteInt64(long)

Writes a 64-bit signed integer in little-endian byte order.

Public method WriteSingle(float)

Writes a 32-bit single-precision floating-point value.

Public method WriteVarInt(int)

Writes a non-negative integer using variable-length encoding (LEB128). Small values (0–127) consume a single byte. Encodes into a local buffer then writes all bytes in one call to reduce per-byte overhead.