Sitecore.FakeDb.Data.Engines.DataStorage.SetBlobStream C# (CSharp) Méthode

SetBlobStream() public méthode

public SetBlobStream ( Guid blobId, Stream stream ) : void
blobId Guid
stream Stream
Résultat void
      public virtual void SetBlobStream(Guid blobId, Stream stream)
      {
          Assert.ArgumentNotNull(stream, "stream");
          var currentPostion = stream.Position;

            //it is assumed SC behaviour that when a stream is saved the 
            //original stream position isn't altered.
            //A copy of the stream is made so that a subsequent get using GetBlobStream does not
            //cause a change in original stream position.
          var storedStream = new MemoryStream();
          stream.Seek(0, SeekOrigin.Begin);
          stream.CopyTo(storedStream);
          storedStream.Seek(0, SeekOrigin.Begin);
          stream.Seek(currentPostion, SeekOrigin.Begin);

          this.Blobs[blobId] = stream;
      }