code: func (r *encReader) next() []byte {
  	switch {
  	case r.buf == nil:
  		return nil
  
  	case r.piece != nil:
  		// There is still data available for reading.
  		return r.piece
  
  	case r.lhpos < len(r.buf.lheads):
  		// We're before the last list header.
  		head := r.buf.lheads[r.lhpos]
  		sizebefore := head.offset - r.strpos
  		if sizebefore > 0 {
  			// String data before header.
  			p := r.buf.str[r.strpos:head.offset]
  			r.strpos += sizebefore
  			return p
  		}
  		r.lhpos++
  		return head.encode(r.buf.sizebuf)
  
  	case r.strpos < len(r.buf.str):
  		// String data at the end, after all list headers.
  		p := r.buf.str[r.strpos:]
  		r.strpos = len(r.buf.str)
  		return p
  
  	default:
  		return nil
  	}
  }
docs: // next returns the next piece of data to be read.
  // it returns nil at EOF.