public void Dispose() { if (IsDisposing) { return; } HStream.Close(); WriteStream.Dispose(); }
public void Clear() { WriteStream.Close(); HStream.Close(); File.Delete(HPath); HStream = new FileStream(HPath, FileMode.OpenOrCreate, FileAccess.ReadWrite); ReadOffset = 0; WriteStream = new StreamWriter(HStream, Encoding.UTF8, 256, true); HBuffer.Clear(); }
private void ReadToBuffer() { HStream.Seek(0, SeekOrigin.Begin); using (StreamReader streamReader = new StreamReader(HStream, Encoding.UTF8, false, 1024, true)) { string hline; while ((hline = streamReader.ReadLine()) != null) { HBuffer.Add(hline); } } HStream.Seek(0, SeekOrigin.End); }