MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / WriteString

Method WriteString

Source/Engine/Networking/NetworkStream.cs:236–248  ·  view source on GitHub ↗

Writes data of type into the message. UTF-16 encoded.

(string value)

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 2

WriteInt32Function · 0.85
WriteDataFunction · 0.85

Tested by

no test coverage detected