Line ReadLine(EncodingDetectionTestReader reader, long position) { long sPos = reader.Stream.Position; Line l = reader.GetLine(position); reader.Stream.Seek(sPos, SeekOrigin.Begin); return(l); }
public void TestMethod2() { EncodingDetectionTestReader tr = new EncodingDetectionTestReader(); StreamWriter sw = new StreamWriter(tr.Stream, new UTF8Encoding(false)); sw.Write("Ä"); sw.Flush(); tr.GetLine(0); Assert.AreEqual(Encoding.UTF8.CodePage, tr.Encoding.CodePage); }