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

Method WriteBytes

Source/Engine/Networking/NetworkMessage.cs:16–22  ·  view source on GitHub ↗

Writes raw bytes into the message. The bytes that will be written. The amount of bytes to write from the bytes pointer.

(byte* bytes, int length)

Source from the content-addressed store, hash-verified

14 /// <param name="bytes">The bytes that will be written.</param>
15 /// <param name="length">The amount of bytes to write from the bytes pointer.</param>
16 public void WriteBytes(byte* bytes, int length)
17 {
18 Assert.IsTrue(Position + length <= BufferSize, $"Could not write data of length {length} into message with id={MessageId}! Current write position={Position}");
19 Utils.MemoryCopy(new IntPtr(Buffer + Position), new IntPtr(bytes), (ulong)length);
20 Position += (uint)length;
21 Length = Position;
22 }
23
24 /// <summary>
25 /// Reads raw bytes from the message into the given byte array.

Callers

nothing calls this directly

Calls 2

MemoryCopyMethod · 0.80
IsTrueMethod · 0.45

Tested by

no test coverage detected