public override bool WriteEncode(string path, byte[] bytes) { try { this.FileWriteAllBytes(path, FileIOManagerBase.CustomEncode(this.CryptKeyBytes, bytes)); return(true); } catch (Exception exception) { object[] args = new object[] { path, exception.ToString() }; Debug.LogError(LanguageErrorMsg.LocalizeTextFormat(ErrorMsg.FileWrite, args)); return(false); } }
public override bool WriteBinaryEncode(string path, Action <BinaryWriter> callbackWrite) { try { using (MemoryStream stream = new MemoryStream()) { using (BinaryWriter writer = new BinaryWriter(stream)) { callbackWrite(writer); } this.FileWriteAllBytes(path, FileIOManagerBase.CustomEncode(this.CryptKeyBytes, stream.ToArray())); } return(true); } catch (Exception exception) { object[] args = new object[] { path, exception.ToString() }; Debug.LogError(LanguageErrorMsg.LocalizeTextFormat(ErrorMsg.FileWrite, args)); return(false); } }
public override byte[] Encode(byte[] bytes) { return(FileIOManagerBase.CustomEncode(this.CryptKeyBytes, bytes)); }