Forwards this buffer's position.

@param len The forward distance
@return This buffer
429275
public final LogBuffer forward(final int len) {
        if (position + len > origin + limit) throw new IllegalArgumentException("limit excceed: "
                                                                                + (position + len - origin));

        this.position += len;
        return this;
    }
1321821
public final LogBuffer duplicate(final int len) {
        if (position + len > origin + limit) throw new IllegalArgumentException("limit excceed: "
                                                                                + (position + len - origin));

        // XXX: Do momery copy avoid buffer modified.
        final int end = position + len;
        byte[] buf = Arrays.copyOfRange(buffer, position, end);
        LogBuffer dupBuffer = new LogBuffer(buf, 0, len);
        position = end;
        return dupBuffer;
    }
597676
public function forward($n)
    {
        $n = (int) $n;
        if (($this->position + $n) > $this->getLength()) {
            throw new \OutOfBoundsException(sprintf('No more bytes to read'));
        }

        $this->position += $n;
    }
1013277
public Tensor forward() {
        VarTensor[] varBeliefs = inf.getOutput().varBeliefs;
        double expectedRecall = s.zero();
        for (Var var : vc.getVars()) {
            if (var.getType() == VarType.PREDICTED) {
                VarTensor marg = varBeliefs[var.getId()];
                expectedRecall = s.minus(expectedRecall, marg.getValue(vc.getState(var)));
            }
        }
        y = Tensor.getScalarTensor(s, expectedRecall);
        return y;
    }
541361
protected String getTextEx(int position, int len)
    {
        try {
            return getDocument().getText(position, len);
        } catch (BadLocationException e) {
            e.printStackTrace();
            return "";
        }
    }
979609
public FP64 extend(byte[] bytes, int start, int len) {
    int end = start + len;
    for (int i = start; i < end; i++) {
      extend(bytes[i]);
    }
    return this;
  }
969190
private final ByteBuffer advance() {
    if (position == 0) {
      return null;
    }

    while (position > 0) {
      final int lastIndex = position - 1;
      final int arc = arcs[lastIndex];

      if (arc == 0) {
        // Remove the current node from the queue.
        position--;
        continue;
      }

      // Go to the next arc, but leave it on the stack
      // so that we keep the recursion depth level accurate.
      arcs[lastIndex] = fsa.getNextArc(arc);

      // Expand buffer if needed.
      final int bufferLength = this.buffer.length;
      if (lastIndex >= bufferLength) {
        this.buffer = Arrays.copyOf(buffer, bufferLength + EXPECTED_MAX_STATES);
        this.bufferWrapper = ByteBuffer.wrap(buffer);
      }
      buffer[lastIndex] = fsa.getArcLabel(arc);

      if (!fsa.isArcTerminal(arc)) {
        // Recursively descend into the arc's node.
        pushNode(fsa.getEndNode(arc));
      }

      if (fsa.isArcFinal(arc)) {
        bufferWrapper.clear();
        bufferWrapper.limit(lastIndex + 1);
        return bufferWrapper;
      }
    }

    return null;
  }
622799
public Location upstream( int length )
	{
		if( length < 0 )
		{
			throw new IllegalArgumentException( "Parameter must be >= 0; is=" + length );
		}

		if( Math.signum( mStart - length) == Math.signum( mStart ) || 0 == Math.signum( mStart - length ) )
		{
			return new Location(mStart - length, mStart );
		}
		else
		{
			throw new IndexOutOfBoundsException( "Specified length causes crossing of origin: " + length + "; " + toString() );
		}
	}
119043
private static int get(byte[] block, int offset, ByteBuffer buf, int len) {
    buf.put(block, offset, len);
    return len;
  }
552030
public FP64 extend(char[] chars, int start, int len) {
    int end = start + len;
    for (int i = start; i < end; i++) {
      extend(chars[i]);
    }
    return this;
  }
1369798
public long skip(long n) {
		long skipped=0L;
		int skip;
		while(n>0) {
			if(n<(skip=curr.remaining())) {
				curr.position(curr.position()+(int)n);
				skipped+=skip;
				n=0;
			} else {
				curr.position(curr.limit());
				
				skipped-=skip;
				if(idx<bbs.size()) {
					curr=bbs.get(idx++);
					n-=skip;
				} else {
					n=0;
				}
			}
		}
		return skipped;
	}
672576
def forward_char(self, e): # (C-f)
         """
        self.l_buffer.forward_char(self.argument_reset)
        self.finalize()
506947
public boolean forwardIfCurrentAndNoWordAfter(String str) {
	int c = pos;
	if (forwardIfCurrent(str)) {
	    if (!isCurrentBetween('a', 'z') && !isCurrent('_')) return true;
	}
	pos = c;
	return false;
    }
647252
private int readFromStream(final long length) throws IOException {
        if (getReadableBytes() + length > localCapacity ) {
            throw new IllegalArgumentException("Trying to read too far ahead, will cause wrap-around issues: " + length);
        }
        int total = 0;
        int actual = 0;
        while (total < length && actual != -1) {

            final int localIndex = getLocalWriterIndex();
            final int spaceLeft = getAvailableLocalWritingSpace();
            final int readAtMost = (int)Math.min(length - total, spaceLeft);

            actual = this.is.read(this.buffer, localIndex, readAtMost);

            if (actual > 0) {
                this.writerIndex += actual;
                total += actual;
            }
        }
        return total;
    }
328073
function (len) {
            var result = '';
            if (len) {
                result = this.source.substr(this.position, len);
            } else {
                result = this.source.substr(this.position);
            }
            return result;
        }
131347
private int getNumOfLenBytes(int len) {
        int numOfLenBytes = 0;

        if (len < 128) {
            numOfLenBytes = 1;
        } else if (len < (1 << 8)) {
            numOfLenBytes = 2;
        } else if (len < (1 << 16)) {
            numOfLenBytes = 3;
        } else if (len < (1 << 24)) {
            numOfLenBytes = 4;
        } else {
            numOfLenBytes = 5;
        }
        return numOfLenBytes;
    }
1278551
def seek_line_forward(self):
        
        pos = start_pos = self.file.tell()

        bytes_read, read_str = self.read(self.read_size)

        start = 0
        if bytes_read and read_str[0] in self.line_terminators:
            # The first charachter is a line terminator, don't count this one
            start += 1

        while bytes_read > 0:          
            # Scan forwards, counting the newlines in this bufferfull
            i = start
            while i < bytes_read:
                if read_str[i] in self.line_terminators:
                    self.seek(pos + i + 1)
                    return self.file.tell()
                i += 1

            pos += self.read_size
            self.seek(pos)

            bytes_read, read_str = self.read(self.read_size)

        return None