leejw51 / protobuf-net

Automatically exported from code.google.com/p/protobuf-net
0 stars 0 forks source link

Length Prefix has wrong endianness #86

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Call SerializeWithLengthPrefix() with PrefixStyle.Fixed32

What is the expected output? What do you see instead?
I expect the prefix to be encoded using big endian (network) order. 
Instead, it is encoded little endian order.  This has been verified by
inspecting the prefix value in the output buffer as well as looking at the
source code.  The comment for the PrefixStyle.Fixed32 states "A
fixed-length (big-endian) length prefix is applied to the data".

What version of the product are you using? On what operating system?
I'm using protobuf-net r278 (NET20), on Windows XP.

Original issue reported on code.google.com by ttkamin...@gmail.com on 17 Dec 2009 at 8:18

GoogleCodeExporter commented 9 years ago
Wow; that would be a pretty monumental feck up by me... will investigate.

Original comment by marc.gravell on 17 Dec 2009 at 10:23

GoogleCodeExporter commented 9 years ago
Error is the documentation. Protocol buffers (as per Google) uses little-endian 
everywhere else, so little-endian makes sense here too. Apologies for the 
documentation 
mixup.

Original comment by marc.gravell on 17 Dec 2009 at 10:27

GoogleCodeExporter commented 9 years ago
Thanks for looking into this. Wasn't a big problem, just an inconvenience.

Original comment by ttkamin...@gmail.com on 17 Dec 2009 at 11:10

GoogleCodeExporter commented 9 years ago
Fixed locally, btw; will commit when the other code I'm hacking is stable.

Original comment by marc.gravell on 18 Dec 2009 at 9:24

GoogleCodeExporter commented 9 years ago

Original comment by marc.gravell on 28 Jan 2010 at 7:57