Writes data of type into the message. UTF-16 encoded.
(string value)
| 234 | /// Writes data of type <see cref="string"/> into the message. UTF-16 encoded. |
| 235 | /// </summary> |
| 236 | public void WriteString(string value) |
| 237 | { |
| 238 | // Note: Make sure that this is consistent with the C++ message API! |
| 239 | if (value == null) |
| 240 | { |
| 241 | WriteInt32(0); |
| 242 | return; |
| 243 | } |
| 244 | var stringLength = value.Length; |
| 245 | WriteInt32(stringLength); |
| 246 | fixed (char* ptr = value) |
| 247 | WriteData(new IntPtr(ptr), value.Length * 2); |
| 248 | } |
| 249 | |
| 250 | /// <summary> |
| 251 | /// Reads and returns data of type <see cref="string"/> from the message. UTF-16 encoded. |
nothing calls this directly
no test coverage detected