Exemplo n.º 1
0
        /// <summary>
        /// Internally parses the current data and loads all fields.
        /// </summary>
        protected void ParseData()
        {
            if ((m_Data[0] != (byte)'I') || (m_Data[1] != (byte)'D') || (m_Data[2] != (byte)'3'))
            {
                throw new InvalidDataException(string.Format("Missing ID3 identifier!"));
            }

            Version    = m_Data[3];
            m_Revision = m_Data[4];
            Flags      = CheckFlags(m_Data[5]);
            m_BodySize = ID3v2DeUnsync.Int32(m_Data, 6);
        }
Exemplo n.º 2
0
        bool ParseVersion4(DataFrameReader reader)
        {
            if (!reader.EnsureBuffer(4))
            {
                return false;
            }

            // calc size
            int size = ID3v2DeUnsync.Int32(reader.Read(0, 4), 0);

            // get data
            if (!reader.EnsureBuffer(size))
            {
                return false;
            }

            m_Data = reader.GetBuffer(size);

            // get flags
            m_Flags = ID3v2ExtendedHeaderFlags.FromID3v24(m_Data);
            return true;
        }