Example #1
0
        /// <summary>
        /// Reads an unsigned integer (any size from 1 to 8 bytes) from EBML Element's data section.
        /// </summary>
        /// <returns>a ulong containing the parsed value.</returns>
        public ulong ReadULong()
        {
            if (file == null || ebml_size == 0)
            {
                return(0);
            }
            ByteVector vector = ReadBytes();
            var        ebml   = new EBMLelement((MatroskaID)ebml_id, vector);

            return(ebml.GetULong());
        }
Example #2
0
        /// <summary>
        /// Reads a string from EBML Element's data section (UTF-8).
        /// </summary>
        /// <returns>a string object containing the parsed value.</returns>
        public string ReadString()
        {
            if (file == null)
            {
                return(null);
            }
            ByteVector vector = ReadBytes();
            var        ebml   = new EBMLelement((MatroskaID)ebml_id, vector);

            return(ebml.GetString());
        }
Example #3
0
        /// <summary>
        /// Reads a boolean from EBML Element's data section.
        /// </summary>
        /// <returns>a bool containing the parsed value.</returns>
        public bool ReadBool()
        {
            if (file == null || ebml_size == 0)
            {
                return(false);
            }
            ByteVector vector = ReadBytes();
            var        ebml   = new EBMLelement((MatroskaID)ebml_id, vector);

            return(ebml.GetBool());
        }
Example #4
0
        /// <summary>
        /// Reads a double from EBML Element's data section.
        /// </summary>
        /// <returns>a double containing the parsed value.</returns>
        public double ReadDouble()
        {
            if (file == null || DataSize == 0)
            {
                return(0);
            }
            ByteVector vector = ReadBytes();
            var        ebml   = new EBMLelement((MatroskaID)ebml_id, vector);

            return(ebml.GetDouble());
        }