Be.Windows.Forms.FileByteProvider.ApplyChanges C# (CSharp) Метод

ApplyChanges() публичный Метод

Updates the file with all changes the write buffer contains.
public ApplyChanges ( ) : void
Результат 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();
        }