[Mono-dev] BinaryReader does not reset decoder

Martin Dvořák 155144 at gmail.com
Wed Sep 9 10:31:34 EDT 2009


Hi,
While looking at the source code of System.IO.BinaryReader [1] I
noticed it reuses char decoder and I'm just wondering whether it is ok
that the BinaryReader does not reset its internal state before the
loop in ReadString method. What if the code fails e.g. on line 498
(sb.Append...) while the decoder contains fallback data. Next time
ReadString is called, it will fail because decoder will try to use
fallback data from previous call to ReadString. Or am I missing
something here?
Thanks, Martin

[1]
http://anonsvn.mono-project.com/viewvc/trunk/mcs/class/corlib/System.IO/BinaryReader.cs?revision=115560&view=markup


More information about the Mono-devel-list mailing list