Exemplo n.º 1
0
 /// <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());
		}
Exemplo n.º 3
0
		private void WriteNullBitmap(IWriteBuffer context, BitMap4 bitMap)
		{
			context.WriteBytes(bitMap.Bytes());
		}
		/// <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);
		}
		public override void Write(IWriteBuffer buffer, string str)
		{
			buffer.WriteBytes(Encode(str));
		}
Exemplo n.º 6
0
 private void WriteNullBitmap(IWriteBuffer context, BitMap4 bitMap)
 {
     context.WriteBytes(bitMap.Bytes());
 }
Exemplo n.º 7
0
        private static void WriteGuid(object obj, IWriteBuffer context)
        {
            Guid id = (Guid)obj;

            context.WriteBytes(id.ToByteArray());
        }
Exemplo n.º 8
0
 public override void Write(IWriteBuffer buffer, string str)
 {
     buffer.WriteBytes(Encode(str));
 }