Example #1
0
 public static void Write(Stream stream, string value)
 {
     if (value == null)
     {
         NetworkByteOrderConverter.WriteInt32(stream, -1);
     }
     else
     {
         byte[] buffer = Encoding.UTF8.GetBytes(value);
         NetworkByteOrderConverter.WriteInt32(stream, buffer.Length);
         stream.Write(buffer, 0, buffer.Length);
     }
 }
Example #2
0
 public static void Write(Stream stream, int value)
 {
     NetworkByteOrderConverter.WriteInt32(stream, value);
 }