internal BoundedStream(Stream source, string name, Func <FieldLength> maxLengthDelegate = null) { Source = source ?? throw new ArgumentNullException(nameof(source)); _name = name; _maxLengthDelegate = maxLengthDelegate; /* Store for performance */ _canSeek = source.CanSeek; if (_canSeek) { _length = source.Length; } _root = this; while (_root.Source is BoundedStream root) { _root = root; } }
public AsyncBinaryReader(BoundedStream input, Encoding encoding) : base(input, encoding) { InputStream = input; _encoding = encoding; }
public AsyncBinaryWriter(BoundedStream output, Encoding encoding) : base(output, encoding) { OutputStream = output; _encoding = encoding; }