예제 #1
0
 protected override void Dispose(bool disposing)
 {
     if (_blob != null)
     {
         lock (_blob)
         {
             _blob._alreadyOpen = false;
             _blob = null;
         }
     }
 }
예제 #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());
     }
 }
예제 #3
0
 public BlobStream(StreamBlob blob)
 {
     _blob = blob;
 }
예제 #4
0
 protected override void Dispose(bool disposing)
 {
     if (_blob != null)
         lock (_blob)
         {
             _blob._alreadyOpen = false;
             _blob = null;
         }
 }
예제 #5
0
 public BlobStream(StreamBlob blob)
 {
     _blob = blob;
 }