public Clear ( bool withInternalArrayResize ) : void | ||
withInternalArrayResize | bool | |
return | void |
public void Clear(bool withInternalArrayResize)
{
lock (_lock)
{
_ptrEnd = 0;
if (withInternalArrayResize)
{
_capacity = _initialCapacity;
_f = new byte[_initialCapacity];
}
}
}
/// <summary> /// /// </summary> /// <param name="newTableFullPath"></param> public void RestoreTableFromTheOtherTable(string newTableFullPath) { lock (lock_fs) { if (_fsData != null) { _fsData.Dispose(); _fsData = null; } if (_fsRollback != null) { _fsRollback.Dispose(); _fsRollback = null; } if (_fsRollbackHelper != null) { _fsRollbackHelper.Dispose(); _fsRollbackHelper = null; } _randBuf.Clear(); _rollbackCache.Clear(); usedBufferSize = 0; eofRollback = 0; eofData = 0; fsLength = 0; _seqBuf.Clear(true); this._configuration.FSFactory.Delete(this._fileName); this._configuration.FSFactory.Delete(this._fileName + ".rol"); this._configuration.FSFactory.Delete(this._fileName + ".rhp"); //File.Delete(this._fileName); //File.Delete(this._fileName + ".rol"); //File.Delete(this._fileName + ".rhp"); if (this._configuration.FSFactory.Exists(newTableFullPath)) { this._configuration.FSFactory.Move(newTableFullPath, this._fileName); } if (this._configuration.FSFactory.Exists(newTableFullPath + ".rol")) { this._configuration.FSFactory.Move(newTableFullPath + ".rol", this._fileName + ".rol"); } if (this._configuration.FSFactory.Exists(newTableFullPath + ".rhp")) { this._configuration.FSFactory.Move(newTableFullPath + ".rhp", this._fileName + ".rhp"); } InitFiles(); } }