public bool WriteFile(StoreFile file, string dataPath, StoreMode storeMode) { if(file == null || dataPath == null) { throw new ArgumentNullException("file"); } if(File.Exists(dataPath)) { try { byte[] buffer = File.ReadAllBytes(dataPath); SetFileData(file, buffer, storeMode); } catch { file.ResetData(); return false; } } return true; }