code: func (d *decoder) Decode(defaults *schema.GroupVersionKind, into runtime.Object) (runtime.Object, *schema.GroupVersionKind, error) {
  	base := 0
  	for {
  		n, err := d.reader.Read(d.buf[base:])
  		if err == io.ErrShortBuffer {
  			if n == 0 {
  				return nil, nil, fmt.Errorf("got short buffer with n=0, base=%d, cap=%d", base, cap(d.buf))
  			}
  			if d.resetRead {
  				continue
  			}
  			// double the buffer size up to maxBytes
  			if len(d.buf) < d.maxBytes {
  				base += n
  				d.buf = append(d.buf, make([]byte, len(d.buf))...)
  				continue
  			}
  			// must read the rest of the frame (until we stop getting ErrShortBuffer)
  			d.resetRead = true
  			base = 0
  			return nil, nil, ErrObjectTooLarge
  		}
  		if err != nil {
  			return nil, nil, err
  		}
  		if d.resetRead {
  			// now that we have drained the large read, continue
  			d.resetRead = false
  			continue
  		}
  		base += n
  		break
  	}
  	return d.decoder.Decode(d.buf[:base], defaults, into)
  }
docs: // Decode reads the next object from the stream and decodes it.