/// <summary> /// Creates a new EBML reader. /// </summary> /// <param name="source">the source of bytes</param> /// <param name="size">the maximum number of bytes to read from the source</param> /// <exception cref="ArgumentNullException">if <code>source</code> is <code>null</code></exception> /// <exception cref="ArgumentNullException">if <code>size</code> is negative</exception> public EbmlReader(Stream source, long size) { if (size < 0L) { throw new ArgumentException("size is negative"); } _source = source ?? throw new ArgumentNullException(nameof(source)); _containers = new Stack <Element>(); _container = new Element(VInt.UnknownSize(2), size, ElementType.MasterElement); _element = Element.Empty; }
private Element() : this(VInt.UnknownSize(2), 0L, ElementType.None) { }