/** * End something. * @param m Mode * @param c Closing character * @return this * @throws JSONException If unbalanced. */ private JSONWriter end(char m, char c) throws JSONException { if (this.mode != m) { throw new JSONException(m == 'o' ? "Misplaced endObject." : "Misplaced endArray."); } this.pop(m); try { this.writer.write(c); } catch (IOException e) { throw new JSONException(e); } this.comma = true; return this; }
/** * End something. * @param m Mode * @param c Closing character * @return this * @throws JSONException If unbalanced. */ private JSONWriter end(char m, char c) throws JSONException { if (this.mode != m) { throw new JSONException(m == 'o' ? "Misplaced endObject." : "Misplaced endArray."); } this.pop(m); try { this.writer.write(c); } catch (IOException e) { throw new JSONException(e); } this.comma = true; return this; }