private static IEnumerator Enumerator(byte[] buffer, int offset, int count, int define, IPacketConverter converter) { for (int idx = 0; idx < count; idx++) { yield return(converter.GetValueWrap(buffer, offset + define * idx, define)); } }
private static IEnumerator Enumerator(List <PacketReader> list, IPacketConverter converter) { for (int idx = 0; idx < list.Count; idx++) { yield return(converter.GetValueWrap(list[idx].element)); } }
internal object Next(ref int index, IPacketConverter converter) { var tmp = index; MoveNext(converter.Length, ref tmp, out var len); var res = converter.GetValueWrap(buffer, tmp, len); index = tmp + len; return(res); }