/** * End something.<p> * * @param m mode * @param c closing character * @return this * @throws JSONException if unbalanced */ private JSONWriter end(char m, char c) throws JSONException { if (m_mode != m) { throw new JSONException(m == 'o' ? "Misplaced endObject." : "Misplaced endArray."); } pop(m); try { m_writer.write(c); } catch (IOException e) { throw new JSONException(e); } m_comma = true; return this; }
/** * End something.<p> * * @param m mode * @param c closing character * @return this * @throws JSONException if unbalanced */ private JSONWriter end(char m, char c) throws JSONException { if (this.m_mode != m) { throw new JSONException(m == 'o' ? "Misplaced endObject." : "Misplaced endArray."); } this.pop(m); try { this.m_writer.write(c); } catch (IOException e) { throw new JSONException(e); } this.m_comma = true; return this; }