/// <summary> /// Protect and write cache data to file. It overrides existing data. /// </summary> /// <param name="data">Cache data</param> public void WriteData(byte[] data) { if (data == null) { throw new ArgumentNullException(nameof(data)); } try { _logger.LogInformation($"Got '{data?.Length}' bytes to write to storage"); CacheAccessor.Write(data); } catch (Exception e) { _logger.LogError($"An exception was encountered while writing data to {nameof(Storage)} : {e}"); throw; } }