Section navigation

Public classStatic CodecFileHeader

Namespace
Rowles.LeanCorpus.Codecs.CodecKit
Assembly
Rowles.LeanCorpus.dll

CodecKit file header read/write for codec files. Supports two formats: Envelope: [version:byte][VarInt64 bodyLen][body] Trailer: [version:byte][body][bodyLen:int64] (8-byte fixed trailer)

public static class CodecFileHeader
Inheritance
CodecFileHeader

Public method BeginStreamingWrite(IndexOutput, byte)

Public method Read(IndexInput, ICodec<byte[]>)

Reads and decodes a codec file. Detects trailer format (raw body) and falls back to envelope format via the codec-chain decode path.

Public method Read(BinaryReader, ICodec<byte[]>)

Public method ReadBody(IndexInput)

Detects format and returns the full body as a byte[]. For envelope files the body codec may add its own framing; prefer Read(IndexInput, ICodec<byte[]>) for those.

Public method ReadVersion(IndexInput)

Public method ReadVersion(IndexInput, ICodec<byte[]>)

Public method ReadVersion(BinaryReader)

Public method ReadVersion(BinaryReader, ICodec<byte[]>)

Public method ReadVersionAndSkipHeader(IndexInput)

Detects trailer vs envelope format, returns the version byte, and leaves input positioned at the start of the body.

Public method ReadVersionAndSkipHeader(BinaryReader)

BinaryReader overload. Envelope-only for now; trailer detection via BinaryReader is not safe due to internal buffering (addressed in Phase C when StoredFieldsReader handles v3).

Public method Read<T>(IndexInput, ICodec<byte[]>, ICodec<T>)

Public method Write(IndexOutput, ICodec<byte[]>, byte[])

Public method Write(IndexOutput, ICodec<byte[]>, ReadOnlySpan<byte>)

Public method Write(BinaryWriter, ICodec<byte[]>, byte[])

Public method Write(BinaryWriter, ICodec<byte[]>, ReadOnlySpan<byte>)