
IndexOutput
- Namespace
- Rowles.LeanCorpus.Store
- Assembly
- Rowles.LeanCorpus.dll
Buffered sequential writer backed by FileStream and ArrayPool<T>. Used at index-build time only.
public sealed class IndexOutput : IDisposable
- Inheritance
-
IndexOutput
- Implements
IndexOutput(string, bool, bool, long)
Creates a new file at filePath and opens it for buffered sequential writing.
Position
Current logical write position (buffered + flushed).
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.
Write7BitEncodedInt(int)
Writes a non-negative integer using 7-bit encoding, compatible with Write7BitEncodedInt(int). Small values (0–127) consume a single byte.
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.
WriteChars(ReadOnlySpan<char>)
Writes a char span as raw UTF-8 bytes (no length prefix). Compatible with Write(char[]).
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.
WriteString(string)
Writes a length-prefixed UTF-8 string, compatible with Write(string).
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.