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
291 stars 62 forks source link

Insert data interpretation layer #77

Open jefffhaynes opened 6 years ago

jefffhaynes commented 6 years ago

At some point in the distant future, remove weird work-around for deferred evaluation of endianness and add an interpretation layer that decouples reading and writing from value representation

Waelwindows commented 6 years ago

Would this work as a post-deserialization step where you can process your data (using functions and the like)?

jefffhaynes commented 6 years ago

No, the idea is simply to decouple the interpretation of the data (e.g converting four bytes into an int) from the reading of the data. This is especially relevant when endianness comes into play and there are some hacky things happening in the current design because the decoupling isn’t that clean right now.

— If you want to build a ship, don't drum up people to collect wood and don't assign them tasks and work, but rather teach them to long for the endless immensity of the sea.

Antoine de Saint-Exupery


From: Waelwindows notifications@github.com Sent: Friday, April 6, 2018 4:23:10 AM To: jefffhaynes/BinarySerializer Cc: Jeff Haynes; Assign Subject: Re: [jefffhaynes/BinarySerializer] Insert data interpretation layer (#77)

Would this work as a post-(de)serialization step where you can process your data?

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHubhttps://github.com/jefffhaynes/BinarySerializer/issues/77#issuecomment-379183859, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AJSKRwkmRWegqWN1-NUGOOFVLGVWOwnyks5tlyXugaJpZM4QjJl_.

Waelwindows commented 6 years ago

Ah, so will this help with the FieldScale bug you have with a different endianness?

jefffhaynes commented 6 years ago

Maybe. What bug is that? 🙂

Waelwindows commented 6 years ago

If you have a field with the FieldScale attribute in Little Endian it deserializes correctly, however, if you try the same but in BigEndian, you get garbled data.

jefffhaynes commented 6 years ago

Then yes, that’s probably related. Would you mind entering that as a separate bug if it isn’t already?

jefffhaynes commented 6 years ago

Thanks!


From: Waelwindows notifications@github.com Sent: Friday, April 6, 2018 5:14:55 AM To: jefffhaynes/BinarySerializer Cc: Jeff Haynes; Assign Subject: Re: [jefffhaynes/BinarySerializer] Insert data interpretation layer (#77)

If you have a field with the FieldScale attribute in Little Endian it deserializes correctly, however, if you try the same but in BigEndian, you get garbled data.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHubhttps://github.com/jefffhaynes/BinarySerializer/issues/77#issuecomment-379196419, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AJSKR_SL6jwuz-aic6R1Aom367NB_X9jks5tlzIPgaJpZM4QjJl_.