Files
SabreTools.Serialization/Interfaces/IByteSerializer.cs

19 lines
675 B
C#
Raw Permalink Normal View History

namespace SabreTools.Serialization.Interfaces
2023-09-08 16:54:07 -04:00
{
/// <summary>
/// Defines how to serialize to and from byte arrays
/// </summary>
public interface IByteSerializer<T>
{
/// <summary>
/// Deserialize a byte array into <typeparamref name="T"/>
/// </summary>
/// <typeparam name="T">Type of object to deserialize to</typeparam>
/// <param name="data">Byte array to parse</param>
/// <param name="offset">Offset into the byte array</param>
/// <returns>Filled object on success, null on error</returns>
T? Deserialize(byte[]? data, int offset);
2023-09-08 21:12:19 -04:00
// TODO: Add serialization method
2023-09-08 16:54:07 -04:00
}
}