
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
Constructors
IndexOutput(string, bool)
Creates a new file at
filePathand opens it for buffered sequential writing.
Properties
Position
Current logical write position (buffered + flushed).
Methods
Dispose()
Flushes remaining buffered data and releases all resources.
Flush()
Flushes the internal write buffer to the underlying file stream.
Seek(long)
Seeks to an absolute position. Flushes the buffer first to ensure consistency. Use sparingly — this forces a buffer flush.
WriteBoolean(bool)
Writes a boolean as a single byte (0 or 1).
WriteByte(byte)
Writes a single byte to the output, flushing the buffer if it is full.
WriteBytes(byte[])
Writes all bytes from the given array to the output.
WriteBytes(ReadOnlySpan<byte>)
Writes the bytes from the given span to the output, flushing the internal buffer as needed.
WriteInt32(int)
Writes a 32-bit signed integer in little-endian byte order.
WriteInt64(long)
Writes a 64-bit signed integer in little-endian byte order.
WriteSingle(float)
Writes a 32-bit single-precision floating-point value.
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.