Sitecore.FakeDb.Data.Engines.DataStorage.GetBlobStream C# (CSharp) Method

GetBlobStream() public method

public GetBlobStream ( Guid blobId ) : Stream
blobId Guid
return Stream
      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;
      }