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

Method ReadBytes

Source/Engine/Networking/NetworkMessage.cs:32–37  ·  view source on GitHub ↗

Reads raw bytes from the message into the given byte array. The buffer pointer that will be used to store the bytes. Should be of the same length as length or longer. The minimal amount of bytes that the buffer contains.

(byte* buffer, int length)

Source from the content-addressed store, hash-verified

30 /// </param>
31 /// <param name="length">The minimal amount of bytes that the buffer contains.</param>
32 public void ReadBytes(byte* buffer, int length)
33 {
34 Assert.IsTrue(Position + length <= Length, $"Could not read data of length {length} from message with id={MessageId} and size of {Length}B! Current read position={Position}");
35 Utils.MemoryCopy(new IntPtr(buffer), new IntPtr(Buffer + Position), (ulong)length);
36 Position += (uint)length;
37 }
38
39 /// <summary>
40 /// Writes raw bytes into the message.

Callers

nothing calls this directly

Calls 3

ReadBytesFunction · 0.85
MemoryCopyMethod · 0.80
IsTrueMethod · 0.45

Tested by

no test coverage detected