/// <summary>
        /// Loads ID3v2ExtendedHeaderFlags from the specified ID3v2.4 extended header.
        /// </summary>
        /// <param name="extendedHeader"></param>
        /// <returns></returns>
        public static ID3v2ExtendedHeaderFlags FromID3v24(byte[] extendedHeader)
        {
            if (extendedHeader == null)
            {
                throw new ArgumentNullException("ExtendedHeader");
            }

            if (extendedHeader[4] != 1)
            {
                throw new InvalidDataException(string.Format("Invalid number of flag bytes!"));
            }

            var i = 6;

            // flag 1000 0000
            if ((extendedHeader[5] & 0x80) != 0)
            {
                SkipFlag(extendedHeader, ref i);
            }

            // flag 0100 0000
            var l_TagIsUpdate = (extendedHeader[5] & 0x40) != 0;

            if (l_TagIsUpdate)
            {
                SkipFlag(extendedHeader, ref i);
            }

            // flag 0010 0000
            byte[] cRC32;
            if ((extendedHeader[5] & 0x20) != 0)
            {
                cRC32 = ReadCRC32(extendedHeader, ref i);
            }
            else
            {
                cRC32 = null;
            }

            // flag 0001 0000
            ID3v2ExtendedHeaderRestrictions l_TagRestrictions;

            if ((extendedHeader[5] & 0x10) == 0)
            {
                l_TagRestrictions = null;
            }
            else
            {
                var bytes = ReadFlag(extendedHeader, ref i);
                if (bytes.Length != 1)
                {
                    throw new InvalidDataException(string.Format("Invalid data length"));
                }

                l_TagRestrictions = ID3v2ExtendedHeaderRestrictions.FromID3v24(bytes[0]);
            }

            // read unknown flags (0000 xxxx)
            for (var n = 0x08; n != 0; n >>= 1)
            {
                SkipFlag(extendedHeader, ref i);
            }
            if (i != extendedHeader.Length)
            {
                throw new InvalidDataException(string.Format("Unexpected additional data at flag!"));
            }

            return(new ID3v2ExtendedHeaderFlags(l_TagIsUpdate, cRC32, l_TagRestrictions));
        }
 /// <summary>
 /// Creates new ID3v2ExtendedHeaderFlags with the specified settings.
 /// </summary>
 /// <param name="tagIsUpdate"></param>
 /// <param name="cRC32">The crc32 of all frames (tag without headers, padding and footer).</param>
 /// <param name="tagRestrictions"></param>
 public ID3v2ExtendedHeaderFlags(bool tagIsUpdate, byte[] cRC32, ID3v2ExtendedHeaderRestrictions tagRestrictions)
 {
     TagIsUpdate     = tagIsUpdate;
     CRC32           = cRC32;
     TagRestrictions = tagRestrictions;
 }