public void Write(DataBase <T> pDataBase, IDbSource pTarget) { lock (_syncLock) { var stream = pTarget.GetStream(); _serializer.Write(pDataBase, stream); StreamUtils.CloseStream(stream); } }
public DataBase <T> Read(IDbSource pSource) { DataBase <T> dataBase; lock (_syncLock) { var stream = pSource.GetStream(); dataBase = _serializer.Read(stream); StreamUtils.CloseStream(stream); dataBase.DbSource = pSource; } return(dataBase); }