public void WriteIdentifier(Mpd.Generic.IO.FileDataIO pFile, bool bKadExcludeMD4)
        {
            uint uIncludesMD4      = bKadExcludeMD4 ? (uint)0 : (uint)1; // This is (currently) mandatory except for Kad
            uint uIncludesSize     = (FileSize != 0) ? (uint)1 : (uint)0;
            uint uIncludesAICH     = HasAICHHash ? (uint)1 : 0;
            uint uMandatoryOptions = 0; // RESERVED - Identifier invalid if we encounter unknown options
            uint uOptions          = 0; // RESERVED

            byte byIdentifierDesc = (byte)
                                    ((uOptions << 5) |
                                     (uMandatoryOptions << 3) |
                                     (uIncludesAICH << 2) |
                                     (uIncludesSize << 1) |
                                     (uIncludesMD4 << 0));

            pFile.WriteUInt8(byIdentifierDesc);
            if (!bKadExcludeMD4)
            {
                pFile.WriteHash16(md4Hash_);
            }
            if (FileSize != (ulong)0)
            {
                pFile.WriteUInt64(FileSize);
            }
            if (HasAICHHash)
            {
                aichHash_.Write(pFile);
            }
        }
Beispiel #2
0
        public void WriteAICHHashsetToFile(Mpd.Generic.IO.FileDataIO pFile)
        {
            AICHHash.Write(pFile);
            int uParts = m_aAICHPartHashSet.Count;

            pFile.WriteUInt16((ushort)uParts);
            for (int i = 0; i < uParts; i++)
            {
                m_aAICHPartHashSet[i].Write(pFile);
            }
        }