using System; namespace Capnp { /// /// SerializerState specialization for List(Void). /// public class ListOfEmptySerializer: SerializerState { /// /// This list's element count. /// public int Count => ListElementCount; /// /// Initializes this list with a specific size. The list can be initialized only once. /// /// List element count /// The list was already initialized /// is negative or greater than 2^29-1 public void Init(int count) { if (IsAllocated) throw new InvalidOperationException("Already initialized"); if (count < 0) throw new ArgumentOutOfRangeException(nameof(count)); SetListOfValues(0, count); } } }