Conerlius / protobuf-net

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

Deserializing Object with Byte Array appends the bytes #271

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Please include an e-mail address if this might need a dialogue!
(simon.kang at gmail)
==============

What steps will reproduce the problem?
1. Create ProtoContract Class with a Byte Array ProtoMember
2. In constructor, initialize property with empty byte array
3. Create an object with a byte array.
4. Serialize and Deserialize the object

What is the expected output? What do you see instead?
Expected the property to be overwritten with data from byte stream. Instead the 
bytes were appended.

What version of the product are you using? On what operating system?
2.0.0.480 (From Nuget)

Please provide any additional information below.
After figuring out what was happening, I set the ProtoContract Attribute's 
SkipContructor property to true. Then the property will be initially null, 
therefore no constructor initialized byte array.

Original issue reported on code.google.com by simon.k...@gmail.com on 6 Feb 2012 at 10:48

GoogleCodeExporter commented 8 years ago
This is already fixed in a pending build (r484, IIRC), by using the 
OverwriteList option

Original comment by marc.gravell on 6 Feb 2012 at 11:19