public override void Write(byte[] buffer, int offset, int count) {
if (!CanWrite) {
throw new NotSupportedException();
}
long oldLen = _originalStream.Length;
long newLen = _originalStream.CanSeek ? _originalStream.Position + (long)count :
_originalStream.Length + (long)count;
EnsureQuota(Math.Max(oldLen, newLen));
_originalStream.Write(buffer, offset, count);
}