NotableDateBinaryResource Class
Definition
- Namespace
- Bodu.Globalization.Calendar
- Assembly
- Bodu.Globalization.Calendar.dll
- Package
- Bodu.Globalization.Calendar 1.0.1
Writes and reads the sealed notable-date binary rule-pack format (.bcal): a compact, integrity-checked,
reflection-free encoding of a validated NotableDateResource.
public static class NotableDateBinaryResource
- Inheritance
-
NotableDateBinaryResource
- Inherited Members
Remarks
A pack is written from an already-built resource, so only content that passed the canonical loader's validation is ever encoded, and reading a pack skips parsing and validation entirely - the trim- and AOT-friendly load path. The format is sealed: it enumerates the engine's strategy, recurrence, and duration types exhaustively with one-byte discriminators, carries no type names and no extension points, and the reader rejects unknown versions, unknown discriminators, undefined enum values, out-of-range references, truncation, and payload-digest mismatches with NotableDateBinaryFormatException.
Writing is byte-stable: the same resource always produces the same bytes, so build systems can use pack outputs for up-to-date checks.
Methods
Read(Stream)
Reads a resource from a stream in the binary rule-pack format.
public static NotableDateResource Read(Stream stream)
Parameters
streamStreamThe readable stream positioned at the start of a pack.
Returns
- NotableDateResource
The decoded resource.
Exceptions
- ArgumentNullException
streamis null.- NotableDateBinaryFormatException
The stream is not a notable-date binary rule pack, declares an unsupported format version, is truncated or corrupted, or carries a value outside the sealed format's tables.
Write(NotableDateResource, Stream)
Writes a resource to a stream in the binary rule-pack format.
public static void Write(NotableDateResource resource, Stream stream)
Parameters
resourceNotableDateResourceThe validated resource to encode.
streamStreamThe writable stream receiving the pack.
Exceptions
- ArgumentNullException
resourceorstreamis null.
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |