// peekByte returns the next byte from the input reader but does not advance beyond it.
// If skipSpace is set, peekByte skips leading spaces and comments.
971352
func (r *importReader) peekByte(skipSpace bool) byte {
	if r.err != nil {
		if r.nerr++; r.nerr > 10000 {
			panic("go/build: import reader looping")
		}
		return 0
	}

	// Use r.peek as first input byte.
	// Don't just return r.peek here: it might have been left by peekByte(false)
	// and this might be peekByte(true).
	c := r.peek
	if c == 0 {
		c = r.readByte()
	}
	for r.err == nil && !r.eof {
		if skipSpace {
			// For the purposes of this reader, semicolons are never necessary to
			// understand the input and are treated as spaces.
			switch c {
			case ' ', '\f', '\t', '\r', '\n', ';':
				c = r.readByte()
				continue

			case '/':
				c = r.readByte()
				if c == '/' {
					for c != '\n' && r.err == nil && !r.eof {
						c = r.readByte()
					}
				} else if c == '*' {
					var c1 byte
					for (c != '*' || c1 != '/') && r.err == nil {
						if r.eof {
							r.syntaxError()
						}
						c, c1 = c1, r.readByte()
					}
				} else {
					r.syntaxError()
				}
				c = r.readByte()
				continue
			}
		}
		break
	}
	r.peek = c
	return r.peek
}
794789
func (r *reader) nextByte() byte {
	r.pos += 1
	if r.pos > r.size {
		_panicf("nextByte: insufficient buffer (%d of %d)", r.pos, r.size)
	}
	return r.buf[r.pos-1]
}
411018
func (in *DataInputImpl) SkipBytes(numBytes int64) (err error) {
	assert2(numBytes >= 0, "numBytes must be >= 0, got %v", numBytes)
	if in.skipBuffer == nil {
		in.skipBuffer = make([]byte, SKIP_BUFFER_SIZE)
	}
	assert(len(in.skipBuffer) == SKIP_BUFFER_SIZE)
	var step int
	for skipped := int64(0); skipped < numBytes; {
		step = int(numBytes - skipped)
		if SKIP_BUFFER_SIZE < step {
			step = SKIP_BUFFER_SIZE
		}
		if err = in.ReadBytesBuffered(in.skipBuffer[:step], false); err != nil {
			return
		}
		skipped += int64(step)
	}
	return nil
}
27586
func (ch *Chunk) ReadByte() (byte, error) {
	if ch.IsFullyRead() {
		return 0, io.EOF
	}
	var r byte
	err := ch.ReadLE(&r)
	return r, err
}
41219
func (d *Decoder) readBytes(delim byte) (line []byte, err error) {
	line, err = d.r.ReadBytes(delim)
	if d.raw {
		d.buf = append(d.buf, line...)
	}
	d.n += len(line)
	return
}
509598
func (l *pageLexer) peek() rune {
	r := l.next()
	l.backup()
	return r
}
215090
func (b *ByteBuf) PeekInt(offset int) (int, error) {
	if b.Readable() < 4+offset {
		return 0, io.ErrShortBuffer
	}

	start := b.readerIndex + offset
	return Byte2Int(b.buf[start : start+4]), nil
}
624631
func (p *Parser) peek() rune {
	r := p.next()
	p.backup()
	return r
}
1172134
func (sc *scanner) peekRune() rune {
	if len(sc.rest) == 0 {
		return 0
	}

	// fast path: ASCII
	if b := sc.rest[0]; b < utf8.RuneSelf {
		if b == '\r' {
			return '\n'
		}
		return rune(b)
	}

	r, _ := utf8.DecodeRune(sc.rest)
	return r
}
1313161
func (c *Conn) Peek(id uint64) (body []byte, err error) {
	r, err := c.cmd(nil, nil, nil, "peek", id)
	if err != nil {
		return nil, err
	}
	return c.readResp(r, true, "FOUND %d", &id)
}
949865
func (b *Builder) ReadByte() (c byte, err error) {
	b.lastRead = opInvalid
	if b.off >= len(b.buf) {
		// Buffer is empty, reset to recover space.
		b.Truncate(0)
		return 0, io.EOF
	}
	c = b.buf[b.off]
	b.off++
	b.lastRead = opRead
	return c, nil
}
1359604
func (r *importReader) nextByte(skipSpace bool) byte {
	c := r.peekByte(skipSpace)
	r.peek = 0
	return c
}
1103896
func (l *StringLexer) PeekString(word string) bool {
	return AcceptString(l, word, true)
}
1191210
func (cr *iso88591CharsetReader) ReadByte() (b byte, err error) {
	if cr.buffer.Len() <= 0 {
		r, err := cr.reader.ReadByte()
		if err != nil {
			return 0, err
		}
		if r < utf8.RuneSelf {
			return r, nil
		}
		cr.buffer.WriteRune(rune(r))
	}
	return cr.buffer.ReadByte()
}
946942
func skipSpace(r *bufio.Reader) int {
	n := 0
	for {
		c, err := r.ReadByte()
		if err != nil {
			// bufio will keep err until next read.
			break
		}
		if !isSpace(c) {
			r.UnreadByte()
			break
		}
		n++
	}
	return n
}
411699
func (s *Simulator) peekEvent() *event {
	if len(s.events) == 0 {
		return nil
	}
	return &s.events[0]
}
29545
func (r *MemUvarintReader) SkipBytes(count int) {
	r.C = r.C + count
}