
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
BeginStreamingWrite(IndexOutput, byte)
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.
Read(BinaryReader, ICodec<byte[]>)
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.
ReadVersion(IndexInput)
ReadVersion(IndexInput, ICodec<byte[]>)
ReadVersion(BinaryReader)
ReadVersion(BinaryReader, ICodec<byte[]>)
ReadVersionAndSkipHeader(IndexInput)
Detects trailer vs envelope format, returns the version byte, and leaves
input positioned at the start of the body.
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).