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;
            }
        }
Пример #2
0
 public AsyncBinaryReader(BoundedStream input, Encoding encoding) : base(input, encoding)
 {
     InputStream = input;
     _encoding   = encoding;
 }
Пример #3
0
 public AsyncBinaryWriter(BoundedStream output, Encoding encoding, byte paddingValue) : base(output, encoding)
 {
     OutputStream  = output;
     _encoding     = encoding;
     _paddingValue = paddingValue;
 }
Пример #4
0
 public AsyncBinaryWriter(BoundedStream output, Encoding encoding) : base(output, encoding)
 {
     OutputStream = output;
     _encoding    = encoding;
 }