public void TypelessWrite(Amf3String str) { // has this string been written before with this writer? if (str.mWriter == this) { // write string id reference TypelessWrite(str.mId << 1); return; } // special case empty strings if (string.IsNullOrEmpty(str.Value)) { TypelessWrite(1); return; } // lookup string by value int index; if (stringTable.TryGetValue(str.Value, out index)) { // cache id within string object str.mWriter = this; str.mId = index; // write string id reference TypelessWrite(index << 1); return; } // write UTF8 bytes of string byte[] bytes = str.Bytes; TypelessWrite((bytes.Length << 1) | 1); Stream.Write(bytes); // cache id within string object str.mWriter = this; str.mId = stringTable.Count; // store string value in string table stringTable[str.Value] = str.mId; }
public Value(string name) { mName = new Amf3String(name); }
public Value(Amf3String name) { mName = name; }
public void Write(Amf3String str) { Write(Amf3TypeCode.String); TypelessWrite(str); }
public Span(string name) { mName = new Amf3String(name); }
public Span(Amf3String name) { mName = name; }