Is there a way to do this? I would like to know how many bytes were read from a NetworkStream when I call DeserializeWithLengthPrefix. Since NetworkStream does not support the Position property I cannot see a simple way to do this. Can this be done in a reasonably efficient way? I need to know this for profiling purposes, and it would be ideal to have the profiling overhead as low as possible.
views:
8answers:
1
+1
A:
Oh, that is an excellent question. That isn't currently exposed, but if desired I could add an overload with an out bytesRead
(to include both the overhead of the lentgh-prefix and the object itself, since both have been consumed). I'm trying to avoid too many changes to "v1", but I could certainly add that into "v2" without too much bother.
Marc Gravell
2010-10-28 06:02:42
Thanks! That would be great. I am really looking forward to v2's release.
cloudraven
2010-10-28 06:09:39
@cloudraven - for info, the changes weren't tricky (although they might have been for v1); I hanve't tested it yet, though.
Marc Gravell
2010-10-28 06:21:11