Files
SabreTools.Serialization/SabreTools.Serialization.Readers/IByteReader.cs

23 lines
770 B
C#
Raw Normal View History

namespace SabreTools.Serialization.Readers
2023-09-08 16:54:07 -04:00
{
/// <summary>
/// Defines how to read from byte arrays
2023-09-08 16:54:07 -04:00
/// </summary>
2025-09-26 15:28:53 -04:00
public interface IByteReader<TModel>
2023-09-08 16:54:07 -04:00
{
/// <summary>
/// Enable outputting debug information
/// </summary>
public bool Debug { get; set; }
2023-09-08 16:54:07 -04:00
/// <summary>
2025-09-26 15:28:53 -04:00
/// Deserialize a byte array into <typeparamref name="TModel"/>
2023-09-08 16:54:07 -04:00
/// </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>
2026-01-25 16:15:05 -05:00
public TModel? Deserialize(byte[]? data, int offset);
2023-09-08 16:54:07 -04:00
}
}