code: public void endDocument() throws IOException {
        checkAndPop(JsonTokenType.BEGIN_DOCUMENT);
        if (isArray) {
           writer.endArray();
        } else {
           writer.endObject();
        }
     }
docs: End document.
  
  @throws IOException Something went wrong writing