/// <summary> /// /// </summary> /// <param name="buffer"></param> /// <param name="offset"></param> /// <param name="count"></param> public override void Write(byte[] buffer, int offset, int count) { var start = Position; try { #if DEBUG_ANALYZER Console.WriteLine("Write {0} bytes at {1}", count, Start); #endif base.Write(buffer, offset, count); } finally { _writeUsage.AddAvailableWithBounds(start, Position); } }
/// <summary> /// /// </summary> /// <param name="buffer"></param> /// <param name="offset"></param> /// <param name="count"></param> /// <returns></returns> public override int Read(byte[] buffer, int offset, int count) { var start = Position; try { #if DEBUG_ANALYZER Console.WriteLine("Read {0} bytes at {1}", count, Start); #endif return(base.Read(buffer, offset, count)); } finally { _readUsage.AddAvailableWithBounds(start, Position); } }