예제 #1
0
            internal void Write(EndianWriter ew)
            {
                int pos = ew.Position;

                if (pos + 40 > ew.Length)
                {
                    ew.BaseStream.SetLength(pos + 40);
                }
                ew.Write(ew.Append(name));
                ew.Write(ew.Append(description));
                ew.Write(new Int24(offset, (byte)type));
                ew.Write(children.Length);
                ew.Write(0);
                ew.Write(options.Length);
                ew.Write(optionOffset = ew.Length);
                ew.Position           = ew.Length;
                ew.BaseStream.SetLength(ew.Length + (options.Length * 4));
                for (int x = 0; x < options.Length; x++)
                {
                    ew.Write(ew.Append(options[x]));
                }
                ew.Position = pos + 28;
                ew.Write(maxCount);
                ew.Write(size);
                ew.Position          = pos + 16;
                ew.Write(fieldOffset = ew.Length);
                ew.Position          = fieldOffset;
                for (int x = 0; x < children.Length; x++)
                {
                    children[x].Write(ew);
                }
                ew.Position         = pos + 36;
                ew.Write(nextOffset = ew.Length);
                ew.Flush();
                ew.Position = nextOffset;
            }
예제 #2
0
 public void Write(EndianWriter ew)
 {
     if (ew.Position + 32 > ew.Length)
     {
         ew.BaseStream.SetLength(ew.Position + 32);
     }
     ew.Write(fourcc, false);
     ew.Write(parent, false);
     ew.Write(grandparent, false);
     ew.Write(ew.Append(extension));
     ew.Write(headerLength);
     ew.Write(version);
     ew.Write(fieldCount  = fields.Length);
     ew.Write(fieldOffset = ew.Length);
     ew.Flush();
     ew.Position = fieldOffset;
     for (int x = 0; x < fieldCount; x++)
     {
         fields[x].Write(ew);
     }
 }