public StreamBlob(Stream stream)
{
if (stream == null) throw new ArgumentNullException("stream");
if (!stream.CanRead) throw new NotSupportedException("Stream cannot read. Blobs are read-only.");
this.stream = stream;
try
{
this.initialPosition = stream.CanSeek ? stream.Position : -1L;
}
catch
{
this.initialPosition = -1L;
}
}