Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Are serializations portable to other machines? #89

Open
Bouloulou1138 opened this issue Jan 5, 2020 · 2 comments
Open

[Question] Are serializations portable to other machines? #89

Bouloulou1138 opened this issue Jan 5, 2020 · 2 comments

Comments

@Bouloulou1138
Copy link

Hello,

I have a question and I cannot find somewhere the answer.

Cereal performs binary serialization, which sounds to me that it serializes the primitive types as they are in memory.

So for example, when a float is serialized, the bytes written will represent the float with the standard that the hardware uses, like IEEE 754. This means that the bytestring cannot be loaded by another machine that uses some other standard and not IEEE 754.

Is my understanding correct?

@elliottt
Copy link
Contributor

elliottt commented Jan 5, 2020

If you use the Serialize class interface, the data will be portable as it's consistently serialized as big endian data. If you write custom serializers using the Get and Put modules, it's up to you to ensure that you're producing portable serializations.

@Bouloulou1138
Copy link
Author

That's great! Thank you for your prompt response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants