private HashStream TakeHashStream()
        {
            HashStream hashStream = null;

            if (this.hashStream == null)
            {
                this.hashStream = hashStream = new HashStream(System.ServiceModel.Security.CryptoHelper.CreateHashAlgorithm(base.AlgorithmSuite.DefaultDigestAlgorithm));
                return(hashStream);
            }
            hashStream = this.hashStream;
            hashStream.Reset();
            return(hashStream);
        }
コード例 #2
0
 internal static void PrepareForRetry(IRequestContext requestContext)
 {
     if (requestContext.Request.ContentStream != null && requestContext.Request.OriginalStreamPosition >= 0)
     {
         Stream     stream     = requestContext.Request.ContentStream;
         HashStream hashStream = stream as HashStream;
         if (hashStream != null)
         {
             hashStream.Reset();
             stream = hashStream.GetSeekableBaseStream();
         }
         stream.Position = requestContext.Request.OriginalStreamPosition;
     }
 }