public static void PutString(Buffer buf, string value) { if (value == null) { Bitstream.PutCompressedInt(buf, -1); return; } byte[] bytes = System.Text.UTF8Encoding.UTF8.GetBytes(value); PutCompressedInt(buf, bytes.Length); PutBytes(buf, bytes); }