DerrickBrayanClayton / protobuf-net

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

ProtoInclude reading/writing to IsolatedStorageFileStream in Silverlight 2.0 causes exception. #29

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Please include an e-mail address if this might need a dialogue!
memphisweb@gmail.com ==============

ProtoInclude causes "Attempt to read past the end of the stream" exception
when writing to IsolatedStorageFileStream in Silverlight 2.0.  This
behavior does not occur when writing to a memory stream.

Version 207 SVN

Please provide any additional information below.

View the code that produces the error at
http://memephiswebtech.com/protobuf/protobuftest.html.

I am including the test project as an attachment.

Original issue reported on code.google.com by memphis...@gmail.com on 14 Nov 2008 at 10:36

Attachments:

GoogleCodeExporter commented 8 years ago
I think I typed the page wrong to view the code

http://memphiswebtech.com/protobuf/protobuftest.html

is correct.

Original comment by memphis...@gmail.com on 14 Nov 2008 at 10:41

GoogleCodeExporter commented 8 years ago
OK; thanks for reporting this and providing a test case. I will investigate and 
get 
back to you.

Original comment by marc.gravell on 14 Nov 2008 at 11:31

GoogleCodeExporter commented 8 years ago
I haven't had chance to investigate yet, but you might want to try using the 
"WithLengthPrefix" variants - with this approach, it knows in advance exactly 
how 
much data is available (rather than having to read the stream to exhaustion).

Original comment by marc.gravell on 15 Nov 2008 at 9:06

GoogleCodeExporter commented 8 years ago
Yes, using "WithLingthPrefix" works in both the contrived sample and the real
project.  Now I can continue coding this weekend, but I don't know whether I 
should
to thank you or not :).

I would be interested to know what is going on.  I have attempted to step 
through the
serialization code, but I can't seem to get my head wrapped around it well 
enough to
figure it out on my own. 

Thanks for the help and the very nice project.

Ray Womack

Original comment by memphis...@gmail.com on 15 Nov 2008 at 12:23

GoogleCodeExporter commented 8 years ago
Glad it worked. I fully intend to investigate the underlying issue - but I have 
a lot 
of family commitments this weekend. If I don't get time today, I'll be looking 
at it 
on Monday.

Marc

Original comment by marc.gravell on 16 Nov 2008 at 9:09

GoogleCodeExporter commented 8 years ago
Confirmed; appears to be corruption during serialization, around the first 
alias 
"Billy". Investigating.

Original comment by marc.gravell on 17 Nov 2008 at 8:55

GoogleCodeExporter commented 8 years ago
Raised to critical; affects core pb-net (not just Silverlight) using 
FileStream; 
added to test rig (still investigating)

Original comment by marc.gravell on 17 Nov 2008 at 9:06

GoogleCodeExporter commented 8 years ago
Found and fixed; related to inheritance; MemoryStream is a special case (due to 
buffer manipulation) that was hiding the fault. Will re-release binary shortly.

Original comment by marc.gravell on 17 Nov 2008 at 9:25

GoogleCodeExporter commented 8 years ago

Original comment by marc.gravell on 20 Nov 2008 at 9:50