code: public JsonWriter beginDocument(boolean isArray) throws IOException {
        this.isArray = isArray;
        if (isArray) {
           writer.beginArray();
        } else {
           writer.beginObject();
        }
        writeStack.add(JsonTokenType.BEGIN_DOCUMENT);
        return this;
     }
docs: Begin document
  
  @param isArray True the document is an array structure, false is an object structure
  @return This structured writer
  @throws IOException Something went wrong writing