First two bytes indicate the size of the entire payload, not just the data after it. This is the way I would describe this message:
public class RootEvent
{
[FieldOrder(1)]
public ushort DataLength;
[FieldOrder(2)]
[FieldLength(nameof(DataLength), -sizeof(ushort)] // Second parameter is "adjustment" for the actual length
public object Data;
}
However I don't seem to find a way to implement something similar using this library, did I miss something? 🤔
Consider the following payload:
First two bytes indicate the size of the entire payload, not just the data after it. This is the way I would describe this message:
However I don't seem to find a way to implement something similar using this library, did I miss something? 🤔