/// <summary> /// Note the different implementation when compared to LatinStringIO and UnicodeStringIO: /// Instead of writing the length of the string, UTF8StringIO writes the length of the /// byte array. /// </summary> /// <remarks> /// Note the different implementation when compared to LatinStringIO and UnicodeStringIO: /// Instead of writing the length of the string, UTF8StringIO writes the length of the /// byte array. /// </remarks> public override void WriteLengthAndString(IWriteBuffer buffer, string str) { if (str == null) { buffer.WriteInt(0); return; } byte[] bytes = Encode(str); buffer.WriteInt(bytes.Length); buffer.WriteBytes(bytes); }
private static void WriteGuid(object obj, IWriteBuffer context) { Guid id = (Guid)obj; context.WriteBytes(id.ToByteArray()); }
private void WriteNullBitmap(IWriteBuffer context, BitMap4 bitMap) { context.WriteBytes(bitMap.Bytes()); }
public override void Write(IWriteBuffer buffer, string str) { buffer.WriteBytes(Encode(str)); }