Files
sbox-public/engine/Sandbox.System/Utility/BytePack/BytePack.Convert.cs
s&box team 71f266059a Open source release
This commit imports the C# engine code and game files, excluding C++ source code.

[Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
2025-11-24 09:05:18 +00:00

26 lines
825 B
C#

namespace Sandbox;
internal partial class BytePack
{
/// <summary>
/// Allows classes to specify how they are to be serialized and deserialized through BytePack.
/// </summary>
public interface ISerializer
{
/// <summary>
/// Read from a <see cref="ByteStream"/> and return an object.
/// </summary>
/// <param name="bs">The incoming byte stream.</param>
/// <param name="targetType">The expected type.</param>
/// <returns></returns>
static abstract object BytePackRead( ref ByteStream bs, Type targetType );
/// <summary>
/// Write a value to an outgoing <see cref="ByteStream"/>.
/// </summary>
/// <param name="value">The value to be serialized.</param>
/// <param name="bs">The outgoing byte stream.</param>
static abstract void BytePackWrite( object value, ref ByteStream bs );
}
}