docs: @JRubyMethod(name = {"initialize", "reset"}, optional = 1)
      public static IRubyObject reset(IRubyObject self, IRubyObject[] args) {
          Ruby runtime = self.getRuntime();
          ThreadContext ctx = runtime.getCurrentContext();
          Emitter emitter = (Emitter)self.dataGetStructChecked();
          Extra bonus = (Extra)emitter.bonus;
          bonus.oid = runtime.getNil();
          bonus.port = runtime.newString("");
          bonus.data = RubyHash.newHash(runtime);
              
          IRubyObject options = null;
          IRubyObject tmp;
          if(args.length == 1) {
              options = args[0];
              if(!(tmp = options.checkStringType()).isNil()) {
                  bonus.port = tmp;
              } else if(options.respondsTo("write")) {
                  bonus.port = options;
              } else {
                  options = TypeConverter.convertToTypeWithCheck(options, runtime.getHash(), "to_hash");
                  ((RubyObject)self).fastSetInstanceVariable("@options", options);
              }
          } else {
              options = RubyHash.newHash(runtime);
              ((RubyObject)self).fastSetInstanceVariable("@options", options);
          }
  
  
          emitter.headless = false;
          ((RubyObject)self).fastSetInstanceVariable("@level", runtime.newFixnum(0));
          ((RubyObject)self).fastSetInstanceVariable("@resolver", runtime.getNil());
  
          return self;
      }