public override OssObject Deserialize(ServiceResponse xmlStream)
        {
            OssObject ossObject = new OssObject(_request.Key)
            {
                BucketName     = _request.BucketName,
                ResponseStream = xmlStream.Content,
                Metadata       = DeserializerFactory.GetFactory()
                                 .CreateGetObjectMetadataResultDeserializer().Deserialize(xmlStream)
            };

            DeserializeGeneric(xmlStream, ossObject);

            if (xmlStream.Headers.ContainsKey("x-oss-select-output-raw") &&
                xmlStream.Headers["x-oss-select-output-raw"].Equals("false"))
            {
                var stream = new SelectObjectStream(xmlStream.Content);
                ossObject.ResponseStream = stream;
            }

            return(ossObject);
        }
        public override OssObject Deserialize(ServiceResponse xmlStream)
        {
            OssObject ossObject = new OssObject(_getObjectRequest.Key)
            {
                BucketName     = _getObjectRequest.BucketName,
                ResponseStream = xmlStream.Content,
                Metadata       = DeserializerFactory.GetFactory()
                                 .CreateGetObjectMetadataResultDeserializer().Deserialize(xmlStream)
            };

            DeserializeGeneric(xmlStream, ossObject);

            var conf           = OssUtils.GetClientConfiguration(_serviceClient);
            var originalStream = ossObject.ResponseStream;
            var streamLength   = ossObject.ContentLength;

            // setup progress
            var callback = _getObjectRequest.StreamTransferProgress;

            if (callback != null)
            {
                originalStream           = OssUtils.SetupProgressListeners(originalStream, streamLength, conf.ProgressUpdateInterval, _serviceClient, callback);
                ossObject.ResponseStream = originalStream;
            }

            // wrap response stream in MD5Stream
            if (conf.EnalbeMD5Check)
            {
                byte[] expectedHashDigest = null;
                if (xmlStream.Headers.ContainsKey(HttpHeaders.ContentMd5))
                {
                    var md5OfResponse = xmlStream.Headers[HttpHeaders.ContentMd5];
                    expectedHashDigest = Convert.FromBase64String(md5OfResponse);
                }
                var hashStream = new MD5Stream(originalStream, expectedHashDigest, streamLength);
                ossObject.ResponseStream = hashStream;
            }

            return(ossObject);
        }