Example #1
0
 public int ForEachByteDesc(int index, int length, ByteProcessor processor) => this.Buf.ForEachByteDesc(processor);
Example #2
0
 public int ForEachByteDesc(int index, int length, ByteProcessor processor)
 {
     this.CheckIndex(index, length);
     return -1;
 }
Example #3
0
 public int ForEachByteDesc(ByteProcessor processor) => this.Buf.ForEachByteDesc(processor);
Example #4
0
 public int ForEachByte(int index, int length, ByteProcessor processor) => this.buf.ForEachByte(index, length, processor);
Example #5
0
 public int ForEachByteDesc(ByteProcessor processor) => -1;
Example #6
0
 public int ForEachByte(ByteProcessor processor) => this.buf.ForEachByte(processor);
        int ForEachByteDesc0(int index, int length, ByteProcessor processor)
        {
            if (processor == null)
            {
                throw new NullReferenceException("processor");
            }

            if (length == 0)
            {
                return -1;
            }

            int i = index + length - 1;
            do
            {
                if (processor.Process(this._GetByte(i)))
                {
                    i--;
                }
                else
                {
                    return i;
                }
            }
            while (i >= index);

            return -1;
        }
        public int ForEachByteDesc(ByteProcessor processor)
        {
            int index = this.ReaderIndex;
            int length = this.WriterIndex - index;
            this.EnsureAccessible();

            return this.ForEachByteDesc0(index, length, processor);
        }
        int ForEachByteAsc0(int index, int length, ByteProcessor processor)
        {
            if (processor == null)
            {
                throw new ArgumentNullException(nameof(processor));
            }

            if (length == 0)
            {
                return -1;
            }

            int endIndex = index + length;
            int i = index;
            do
            {
                if (processor.Process(this._GetByte(i)))
                {
                    i++;
                }
                else
                {
                    return i;
                }
            }
            while (i < endIndex);

            return -1;
        }
Example #10
0
        public int ForEachByte(int index, int length, ByteProcessor processor)
        {
            this.CheckIndex(index, length);

            return this.ForEachByteAsc0(index, length, processor);
        }