18 namespace Lucene.Net.Analysis
28 private long currentPosition = -1;
30 private bool isDisposed;
32 internal System.IO.StreamReader input;
37 if (charStream != null)
41 var theString =
new System.IO.MemoryStream(System.Text.Encoding.UTF8.GetBytes(input.ReadToEnd()));
42 return new CharReader(
new System.IO.StreamReader(theString));
46 private CharReader(System.IO.StreamReader in_Renamed) : base(in_Renamed)
51 public override int CorrectOffset(
int currentOff)
56 protected override void Dispose(
bool disposing)
58 if (isDisposed)
return;
70 base.Dispose(disposing);
73 public override int Read(System.Char[] cbuf,
int off,
int len)
75 return input.Read(cbuf, off, len);
78 public bool MarkSupported()
80 return input.BaseStream.CanSeek;
83 public void Mark(
int readAheadLimit)
85 currentPosition = input.BaseStream.Position;
86 input.BaseStream.Position = readAheadLimit;
91 input.BaseStream.Position = currentPosition;