Пример #1
0
        private static void WriteApplefileHeader(List <MimeAppleTranscoder.EntryDescriptor> descriptors, bool isAppleDouble, Stream outStream)
        {
            int num = 26 + 12 * descriptors.Count;

            byte[] array = new byte[num];
            int    num2  = 0;

            MimeAppleTranscoder.WriteUIntData(isAppleDouble ? 333319 : 333312, array, ref num2);
            MimeAppleTranscoder.WriteUIntData(131072, array, ref num2);
            num2 += 16;
            MimeAppleTranscoder.WriteUShortData(descriptors.Count, array, ref num2);
            int num3 = num;

            foreach (MimeAppleTranscoder.EntryDescriptor entryDescriptor in descriptors)
            {
                MimeAppleTranscoder.WriteUIntData(entryDescriptor.EntryId, array, ref num2);
                MimeAppleTranscoder.WriteUIntData(num3, array, ref num2);
                MimeAppleTranscoder.WriteUIntData(entryDescriptor.EntryLength, array, ref num2);
                num3 += entryDescriptor.EntryLength;
            }
            outStream.Write(array, 0, num);
        }