code: func (e *encoder) Encode(obj runtime.Object) error {
  	if err := e.encoder.Encode(obj, e.buf); err != nil {
  		return err
  	}
  	_, err := e.writer.Write(e.buf.Bytes())
  	e.buf.Reset()
  	return err
  }
docs: // Encode writes the provided object to the nested writer.