diff --git a/Source/Engine/Networking/NetworkStream.cs b/Source/Engine/Networking/NetworkStream.cs index 02fb5eab8..bf8b9b269 100644 --- a/Source/Engine/Networking/NetworkStream.cs +++ b/Source/Engine/Networking/NetworkStream.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved. +// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved. using System; using System.Text; @@ -441,5 +441,23 @@ namespace FlaxEngine.Networking ReadBytes((byte*)&value, sizeof(bool)); return value; } + + /// + /// Writes the object data to the stream. Object has to be allocated. + /// + /// The serializable object. + public void Write(INetworkSerializable obj) + { + obj.Serialize(this); + } + + /// + /// Reads the object data from the stream. Object has to be allocated. + /// + /// The serializable object. + public void Read(INetworkSerializable obj) + { + obj.Deserialize(this); + } } }