Exemplo n.º 1
0
    private void compareReaderImplementations(string fileName, Encoding enc)
    {
      string DataPath = "..\\..\\data\\";
      EncodingOptions encOpts = new EncodingOptions();
      encOpts.Encoding = enc;

      Stream s1 = new FileStream(DataPath + fileName, FileMode.Open, FileAccess.Read);
      PositionAwareStreamReader r1 = new PositionAwareStreamReader(s1, encOpts, false);

      Stream s2 = new FileStream(DataPath + fileName, FileMode.Open, FileAccess.Read);
      PositionAwareStreamReader r2 = new PositionAwareStreamReader(s2, encOpts, true);

      for (int lineNum = 0; ; lineNum++)
      {
        string line1 = r1.ReadLine();
        string line2 = r2.ReadLine();
        if (line1 == null && line2 == null)
        {
          break;
        }
        Assert.AreEqual(line1, line2, "File " + fileName);
        Assert.AreEqual(r1.Position, r2.Position, "Zeile " + lineNum + ", File: " + fileName);
      }
    }
Exemplo n.º 2
0
 public XmlLogReader(PositionAwareStreamReader reader)
 {
     StartTag = "<log4j:event";
     EndTag   = "</log4j:event>";
     _reader  = reader;
 }
Exemplo n.º 3
0
 public XmlLogReader(PositionAwareStreamReader reader)
 {
     this.reader = reader;
 }
Exemplo n.º 4
0
		public XmlLogReader(PositionAwareStreamReader reader)
		{
			StartTag = "<log4j:event";
			EndTag = "</log4j:event>";
			_reader = reader;
		}