feat(storage): add binary message record encoding (Go parity)

Add MessageRecord class with Encode/Decode for the binary wire format
used in JetStream file store blocks. Uses varint-encoded lengths,
XxHash64 checksums, and a flags byte for deletion markers.

Go reference: filestore.go:6720-6724, 8180-8250, 8770-8777

13 tests covering round-trip, headers, checksum validation, corruption
detection, varint encoding, deleted flag, empty/large payloads.
This commit is contained in:
Joseph Doherty
2026-02-24 12:12:15 -05:00
parent 2a240c6355
commit 17731e2af5
4 changed files with 436 additions and 0 deletions

View File

@@ -5,6 +5,7 @@
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="IronSnappy" />
<PackageReference Include="System.IO.Hashing" />
<PackageReference Include="NATS.NKeys" />
<PackageReference Include="BCrypt.Net-Next" />
</ItemGroup>