예제 #1
0
        /// <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 (source == null)
            {
                throw new ArgumentNullException("source");
            }
            if (size < 0L)
            {
                throw new ArgumentException("size is negative");
            }

            _source     = source;
            _containers = new Stack <Element>();
            _container  = new Element(VInt.UnknownSize(2), size, ElementType.MasterElement);
            _element    = Element.Empty;
        }
예제 #2
0
 private Element()
     : this(VInt.UnknownSize(2), 0L, ElementType.None)
 {
 }