System.Runtime.Serialization.Plists.BinaryPlistWriter.WriteObjectTable C# (CSharp) Method

WriteObjectTable() private method

Write the object table to the given BinaryWriter.
private WriteObjectTable ( BinaryWriter writer ) : int
writer System.IO.BinaryWriter The to write to.
return int
        private int WriteObjectTable(BinaryWriter writer)
        {
            int offset = this.topLevelObjectOffset;

            foreach (BinaryPlistItem item in this.objectTable)
            {
                this.offsetTable.Add(offset);

                if (item.IsArray)
                {
                    offset += this.WriteArray(writer, item);
                }
                else if (item.IsDictionary)
                {
                    offset += this.WriteDictionary(writer, item);
                }
                else
                {
                    writer.Write(item.Marker.ToArray());

                    if (item.ByteValue.Count > 0)
                    {
                        writer.Write(item.ByteValue.ToArray());
                    }

                    offset += item.Size;
                }
            }

            return offset - this.topLevelObjectOffset;
        }