static IEnumerable <object> CoreBulkRead(CommandReceiver receiver, uint len, ValueKind kind) { for (var i = 0; i < len; i++) { yield return(receiver.ReadValue(kind, out _)); } }
static IEnumerable <object> CoreReadList(CommandReceiver receiver) { var terminated = false; while (!terminated) { var elementKind = (ValueKind)receiver._stream.BaseReader !.ReadByte(); if (elementKind == ValueKind.Group) { throw new InvalidOperationException("Group cannot be contained within an array or list."); } var ret = receiver.ReadValue(elementKind, out terminated); if (!terminated) { yield return(ret); } } }