code: public void write(Bean bean, boolean rootType, Appendable output) throws IOException {
          JodaBeanUtils.notNull(bean, "bean");
          JodaBeanUtils.notNull(output, "output");
          this.output = new JsonOutput(output, settings.getIndent(), settings.getNewLine());
          writeBean(bean, bean.getClass(), rootType ? RootType.ROOT_WITH_TYPE : RootType.ROOT_WITHOUT_TYPE);
          output.append(settings.getNewLine());
      }
docs: Writes the bean to the {@code Appendable} specifying whether to include the type at the root.
  
  @param bean  the bean to output, not null
  @param rootType  true to output the root type
  @param output  the output appendable, not null
  @throws IOException if an error occurs