예제 #1
0
 public void MemoryEnumerator()
 {
     for (int i = 0; i < InnerLoopCount; i++)
     {
         var enumerator = new BufferEnumerator(_readableBuffer.Start, _readableBuffer.End);
         while (enumerator.MoveNext())
         {
             var memory = enumerator.Current;
         }
     }
 }
예제 #2
0
        public static int Seek(ReadCursor begin, ReadCursor end, out ReadCursor result, byte byte0)
        {
            var enumerator = new BufferEnumerator(begin, end);

            while (enumerator.MoveNext())
            {
                var span = enumerator.Current.Span;

                int index = span.IndexOf(byte0);
                if (index != -1)
                {
                    result = enumerator.CreateCursor(index);
                    return(span[index]);
                }
            }

            result = end;
            return(-1);
        }