System.Windows.Forms.FileByteProvider.ApplyChanges C# (CSharp) Method

ApplyChanges() public method

Updates the file with all changes the write buffer contains.
public ApplyChanges ( ) : void
return void
		public void ApplyChanges()
		{
            if (this._readOnly)
            {
                throw new Exception("File is in read-only mode.");
            }

			if(!HasChanges())
				return;

			IDictionaryEnumerator en = _writes.GetEnumerator();
			while(en.MoveNext())
			{
				long index = (long)en.Key;
				byte value = (byte)en.Value;
				if(_fileStream.Position != index)
					_fileStream.Position = index;
				_fileStream.Write(new byte[]{value}, 0, 1);
			}
			_writes.Clear();
		}