public virtual Stream GetBlobStream(Guid blobId)
{
if (!this.Blobs.ContainsKey(blobId))
{
return null;
}
var stream = new MemoryStream();
var storedStream = this.Blobs[blobId];
// Reset stored stream to position zero to ensure data is read.
storedStream.Seek(0,SeekOrigin.Begin);
storedStream.CopyTo(stream);
//after copying the stream we must reset the position to 0
stream.Seek(0, SeekOrigin.Begin);
return stream;
}