code: protected void reset() {
          writer.flush();
          stack.clear();
          context = new JsonContext(JsonContext.Mode.VALUE);
      }
docs: Reset the state of the writer and flush already written content.