private void SerializeWithDataContractInternal <T>(T data, string tempFilePath, DataContractSerializeOptions options)
        {
            var dcs = DataContractSerializeFactory.Create <T>(options);

            using (var file = File.Create(tempFilePath))
                using (var gzipFile = new GZipStream(file, CompressionMode.Compress))
                    using (var writer = XmlWriter.Create(gzipFile, new XmlWriterSettings {
                        Indent = true
                    }))
                    {
                        dcs.WriteObject(writer, data);
                    }
        }
        private void DeserializeXmlDataContractSerializerInternal <T>(string filePath, out T newData, DataContractSerializeOptions options)
        {
            var decompressFilePath = filePath + Guid.NewGuid();

            FileCompressorDecompressor.DecompressFileLZMA(filePath, decompressFilePath);

            var dcs = DataContractSerializeFactory.Create <T>(options);

            try
            {
                using (var gzipStream = new GZipStream(File.OpenRead(decompressFilePath), CompressionMode.Decompress))
                    using (var reader = XmlReader.Create(gzipStream))
                    {
                        newData = (T)dcs.ReadObject(reader);
                    }

                File.Delete(decompressFilePath);
            }
            catch (Exception e)
            {
                newData = default(T);
                throw new ArgumentException("Arquivo inválido - Serializador - Abrir", e);
            }
        }