https://bugzilla.novell.com/show_bug.cgi?id=655934
https://bugzilla.novell.com/show_bug.cgi?id=655934#c1 Steve Bjorg <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #1 from Steve Bjorg <[email protected]> 2011-02-05 21:34:23 UTC --- Here is an implementation of the missing methods. public override string ReadToEnd() { var result = new StringBuilder(); for(var c = Read(); c >= 0; c = Read()) { result.Append((char)c); } return result.ToString(); } public override string ReadLine() { StringBuilder result = null; for(var c = Read(); c >= 0; c = Read()) { // lazy initialize string buffer so we can detect the case where we had already reached the end of the reader result = result ?? new StringBuilder(); // check simple character line ending if(c == '\r') { if(Peek() == '\n') { Read(); } break; } else if(c == '\n') { break; } else { result.Append((char)c); // check if buffered sequence matches Environment.NewLine if(result.Length >= Environment.NewLine.Length) { if(result.ToString(result.Length - Environment.NewLine.Length, Environment.NewLine.Length) == Environment.NewLine) { result.Remove(result.Length - Environment.NewLine.Length, Environment.NewLine.Length); break; } } } } return (result != null) ? result.ToString() : null; } -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug. You are the assignee for the bug. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
