public void Write(EndianBinaryWriterEx writer) { writer.Write(id); writer.WritePSSGString(name); writer.Write(attributeInfo.Count); foreach (KeyValuePair <int, CAttributeInfo> info in attributeInfo) { writer.Write(info.Key); writer.WritePSSGString(info.Value.name); } }
public void Write(System.IO.Stream fileStream) { using (EndianBinaryWriterEx writer = new EndianBinaryWriterEx(new BigEndianBitConverter(), fileStream)) { writer.Write(Encoding.ASCII.GetBytes(magic)); writer.Write(0); writer.Write(attributeInfo.Length); writer.Write(nodeInfo.Length); for (int i = 0; i < nodeInfo.Length; i++) { nodeInfo[i].Write(writer); } if (rootNode != null) { rootNode.UpdateSize(); rootNode.Write(writer); } writer.BaseStream.Position = 4; writer.Write((int)writer.BaseStream.Length - 8); } }
public void Write(EndianBinaryWriterEx writer) { writer.Write(id); writer.Write(size); writer.Write(attributeSize); if (attributes != null) { foreach (KeyValuePair <string, CAttribute> attr in attributes) { attr.Value.Write(writer); } } if (subNodes != null) { foreach (CNode node in subNodes) { node.Write(writer); } } if (isDataNode) { writer.Write(data); } }
public void Write(EndianBinaryWriterEx writer) { writer.Write(id); writer.Write(size); if (data is string) { writer.WritePSSGString((string)data); } else if (data is UInt16) { writer.Write((UInt16)data); } else if (data is UInt32) { writer.Write((UInt32)data); } else if (data is Int16) { writer.Write((Int16)data); } else if (data is Int32) { writer.Write((Int32)data); } else if (data is Single) { writer.Write((Single)data); } else if (data is bool) { writer.Write((bool)data); } else { writer.Write((byte[])data); } }
public void Write(EndianBinaryWriterEx writer) { writer.Write(id); writer.WritePSSGString(name); writer.Write(attributeInfo.Count); foreach (KeyValuePair<int, CAttributeInfo> info in attributeInfo) { writer.Write(info.Key); writer.WritePSSGString(info.Value.name); } }
public void Write(EndianBinaryWriterEx writer) { writer.Write(id); writer.Write(size); writer.Write(attributeSize); if (attributes != null) { foreach (KeyValuePair<string, CAttribute> attr in attributes) { attr.Value.Write(writer); } } if (subNodes != null) { foreach (CNode node in subNodes) { node.Write(writer); } } if (isDataNode) { writer.Write(data); } }