End the ongoing array.

@return The JSON Writer.
163448
public JsonWriter endArray() {
        if (!context.list()) {
            throw new IllegalStateException("Unexpected end, not in list.");
        }
        writer.write(']');
        context = stack.pop();
        return this;
    }
286484
public void endDocument() throws IOException {
      checkAndPop(JsonTokenType.BEGIN_DOCUMENT);
      if (isArray) {
         writer.endArray();
      } else {
         writer.endObject();
      }
   }
81156
def end(self):
        """"""
        for comic in self.data:
            with codecs.open(self.jsonFn(comic), 'w', self.encoding) as f:
                json.dump(self.data[comic], f, indent=2, separators=(',', ': '), sort_keys=True)
1260288
public JsonWriter newJsonWriter() {
        JsonWriter writer = new FastJsonWriter( new StringBuilder() );
        writer.setLenient( true );
        if ( indent ) {
            writer.setIndent( "  " );
        }
        return writer;
    }
919026
@Override
    public String toJson() {
        try {
            return objectMapper.writeValueAsString(status());
        } catch (JsonProcessingException e) {
            throw new RuntimeException(e);
        }
    }
1083615
protected JsonWriter value(@NonNull Object[] array) throws IOException {
      return value(Arrays.asList(array));
   }
171764
synchronized List<Write> close() {
        List<Write> items = new ArrayList<>(this.writes);
        this.writes.clear();
        this.totalLength = 0;
        this.closed = true;
        return items;
    }
51904
public JSONWriter array() {
        if (this.mode == INIT || this.mode == OBJECT || this.mode == ARRAY) {
            this.push(ARRAY);
            this.append("[");
            this.comma = false;
            return this;
        }
        throw new JSONException("Misplaced array: expected mode of INIT, OBJECT or ARRAY but was " + this.mode);
    }
309468
@Override
  public List<List<O>> finish(Collection<? extends OutputWriter<O>> writers) {
    ImmutableList.Builder<List<O>> out = ImmutableList.builder();
    for (OutputWriter<O> w : writers) {
      InMemoryOutputWriter<O> writer = (InMemoryOutputWriter<O>) w;
      out.add(ImmutableList.copyOf(writer.getResult()));
    }
    return out.build();
  }
671058
public long finish() {
    final BAMIndexContent content = indexBuilder.processReference(referenceIndex);
    outputWriter.writeReference(content);
    outputWriter.close();
    return indexBuilder.getNoCoordinateRecordCount();
  }
612709
public boolean inArray() {
      return writeStack.peek() == JsonTokenType.BEGIN_ARRAY || (writeStack.peek() == JsonTokenType.BEGIN_DOCUMENT && isArray);
   }
362490
@Override
  public R finish(Collection<? extends OutputWriter<O>> writers) throws IOException {
    ImmutableList.Builder<OutputWriter<ByteBuffer>> sinkWriters = ImmutableList.builder();
    for (OutputWriter<O> w : writers) {
      Writer<O> writer = (Writer<O>) w;
      sinkWriters.add(writer.out);
    }
    return sink.finish(sinkWriters.build());
  }
1245468
private void writeJsonObjectEnd() throws TException {
        try {
            getCurrentWriter().writeEndObject();
            popContext();
            if (getCurrentContext().isMapKey()) {
                final String writerString = getWriterString();
                popWriter();
                getCurrentWriter().writeFieldName(writerString);
            }

            // flush at the end of the final struct.
            if (1 == contextStack.size()) {
                getCurrentWriter().flush();
            }
        } catch (IOException ex) {
            throw new TException(ex);
        }
    }
1100618
public String beginArray() throws IOException {
      String name = null;
      if (currentValue.getKey() == NAME) {
         name = currentValue.getValue().asString();
         consume();
      }
      if (currentValue.getKey() == BEGIN_ARRAY) {
         consume();
      } else if (readStack.peek() != BEGIN_ARRAY) {
         throw new IOException("Expecting BEGIN_ARRAY, but found " + jsonTokenToStructuredElement(null));
      }
      return name;
   }
557566
public JSONArray construct(){
        JSONArray ret = new JSONArray();
        ret.put(start.getMillis() / 1000);
        ret.put(end.getMillis() / 1000);
        ret.put(runtime);
        ret.put(area);
        ret.put(0);
        ret.put(completed ? 1 : 0);
        return ret;
    }
1289722
public void end() {
		// if (((ArrayList) this.featureCollection).size() == 0) {
		this.endNewElement();
		// }
		contentHandler.endFeatureCollection(this.featureCollection);
		if (writerContentHandler != null)
			geoJSON = writerContentHandler.endFeatureCollection(geoJSON);
	}
28864
public void done() throws JsonWriterException {
    super.doneInternal();
    if (appendable instanceof Flushable) {
      try {
        ((Flushable) appendable).flush();
      } catch (IOException e) {
        throw new JsonWriterException(e);
      }
    }
  }