code: func (s *Stream) Reset(r io.Reader, inputLimit uint64) {
  	if inputLimit > 0 {
  		s.remaining = inputLimit
  		s.limited = true
  	} else {
  		// Attempt to automatically discover
  		// the limit when reading from a byte slice.
  		switch br := r.(type) {
  		case *bytes.Reader:
  			s.remaining = uint64(br.Len())
  			s.limited = true
  		case *strings.Reader:
  			s.remaining = uint64(br.Len())
  			s.limited = true
  		default:
  			s.limited = false
  		}
  	}
  	// Wrap r with a buffer if it doesn't have one.
  	bufr, ok := r.(ByteReader)
  	if !ok {
  		bufr = bufio.NewReader(r)
  	}
  	s.r = bufr
  	// Reset the decoding context.
  	s.stack = s.stack[:0]
  	s.size = 0
  	s.kind = -1
  	s.kinderr = nil
  	if s.uintbuf == nil {
  		s.uintbuf = make([]byte, 8)
  	}
  	s.byteval = 0
  }
docs: // Reset discards any information about the current decoding context
  // and starts reading from r. This method is meant to facilitate reuse
  // of a preallocated Stream across many decoding operations.
  //
  // If r does not also implement ByteReader, Stream will do its own
  // buffering.