Example #1
0
 protected override void Dispose(bool disposing)
 {
     if (_blob != null)
     {
         lock (_blob)
         {
             _blob._alreadyOpen = false;
             _blob = null;
         }
     }
 }
Example #2
0
 public void Get_length_for_blob_gets_length_of_underlying_stream_without_breaking_stream()
 {
     var stream = new MemoryStream(new byte[] {1, 2, 3, 4});
     var blob = new StreamBlob(stream);
     Assert.Equal(4, blob.GetLength());
     using (Stream reader = blob.OpenReader())
     {
         Assert.Equal(1, reader.ReadByte());
         Assert.Equal(2, reader.ReadByte());
         Assert.Equal(3, reader.ReadByte());
         Assert.Equal(4, reader.ReadByte());
     }
 }
Example #3
0
 public BlobStream(StreamBlob blob)
 {
     _blob = blob;
 }
Example #4
0
 protected override void Dispose(bool disposing)
 {
     if (_blob != null)
         lock (_blob)
         {
             _blob._alreadyOpen = false;
             _blob = null;
         }
 }
Example #5
0
 public BlobStream(StreamBlob blob)
 {
     _blob = blob;
 }