jefffhaynes / BinarySerializer

A declarative serialization framework for controlling formatting of data at the byte and bit level using field bindings, converters, and code.
MIT License
290 stars 62 forks source link

Programmatically access local offsets (actually tracked in events) also after the serialization #227

Open abrasat opened 1 year ago

abrasat commented 1 year ago

During the serialization, the events OnMemberSerializing, OnMemberSerialized return also the information about the offset of each property inside the stream generated during the serialization ( #67 ). Is it possible to get programmatically the stream offsets for the different properties from the c# classes after being serialized? I mean something like a GetOffset(nameof(xxx). Or maybe add an option to the Serialize() method to generate a dictionary during the serialization, having the property path as key and the offset inside the serialized stream as value