Closed GoogleCodeExporter closed 9 years ago
are you sure those two "first call" and "second call" are presented the right
way around?
To clarify: the default behaviour of a protobuf stream for the *outermost
object* is to read to the end of the stream, which is fine for files, but is a
PITA on network streams if you haven't closed it yet. Hence, *WithLengthPrefix,
which sends a marker first to limit the amount of data consumed - and making it
possible to have a simple conversation without issue.
I would expect the DeserializeWithLengthPrefix approach to *work*, and the
Deserialize approach to block until the network stream is closed.
Also, note that:
typeModel.Deserialize(ms, myObj, typeof(MyObject));
and
typeModel.DeserializeWithLengthPrefix(ms, myObj, typeof(MyObject),
PrefixStyle.Base128, 70);
are *not* compatible - they do different things. Deserialize is compatible with
Serialize. DeserializeWithLengthPrefix is compatible with
SerializeWithLengthPrefix.
Original comment by marc.gravell
on 13 Jun 2011 at 8:30
Original issue reported on code.google.com by
Erik.Vul...@gmail.com
on 9 Jun 2011 at 12:30