AmfXmlType ReadXML(bool isDocument) { // Stored by ref? bool isInstance; int lengthOrIndex = ReadU29(out isInstance); if (!isInstance) return (AmfXmlType)_objectLookup[lengthOrIndex]; // Stored by value var result = new AmfXmlType { IsDocument = isDocument }; result.Content = ReadPlainString(lengthOrIndex); _objectLookup.Add(result); return result; }
void WriteXML(AmfXmlType xml) { if (TryWriteRef(xml)) return; WritePlainString(xml.Content); }