private IEnumerable <char> GetChars() { var all = _buffer.GetBytes(); for (int index = 0; index < all.Length; index += 2) { yield return(ToChar(all[index], all[index + 1])); } }
private IEnumerable <byte> GetZeroBytes() { foreach (var b in _buffer.GetBytes()) { if (b == 0) { break; } yield return(b); } }
/// <summary> /// Returns an enumerator that iterates through the collection. /// </summary> /// <returns> /// A <see cref="T:System.Collections.Generic.IEnumerator`1" /> that can be used to iterate through the collection. /// </returns> public IEnumerator <byte> GetEnumerator() { return(((IEnumerable <byte>)_buffer.GetBytes()).GetEnumerator()); }