public string ComputeContentStreamHash()
{
if (this.contentStream == null)
return null;
if (this.contentStreamHash == null)
{
var seekableStream = WrapperStream.SearchWrappedStream(this.contentStream, s => s.CanSeek);
if (seekableStream != null)
{
var position = seekableStream.Position;
byte[] payloadHashBytes = CryptoUtilFactory.CryptoInstance.ComputeSHA256Hash(seekableStream);
this.contentStreamHash = AWSSDKUtils.ToHex(payloadHashBytes, true);
seekableStream.Seek(position, SeekOrigin.Begin);
}
}
return this.contentStreamHash;
}