#14043
refactor(domain): one ByteSource representation for streaming parsers
Summary
Streaming parsers declare six copies of the same random-access contract:
NativeByteSourceinnativeSectionDirectory.ts, with an optional prefix.ElfNoteByteSource,ElfDependencyByteSource,V8CodeCacheByteSource,PeImportByteSourceandPeResourceByteSource, each with a requiredprefix: Buffer.
The in-memory adapters are duplicated the same way: a private bufferSource in peResourceInventory.ts, three test-local copies, and the elfNoteByteSource, elfUnwindByteSource and goByteSource fixtures. Their out-of-range behavior differs between copies.
Proposed Change
Add src/domain/byteSource.ts with ByteSource, PrefixedByteSource and bufferByteSource(bytes, prefixBytes?). Its out-of-range reads are short, as a positional file read would be. Migrate every consumer directly and delete the copies.
Activity
0No activity yet.