@Override protected void finishText(final byte[] value) throws IOException { print(','); indent(); print('"'); for (final byte ch : value) encode(ch); print('"'); }
@Override protected void startOpen(final byte[] name) throws IOException { if (lvl != 0) { print(','); indent(); } print("[\""); for (final byte ch : local(name)) encode(ch); print('"'); att = false; }
@Override protected void attribute(final byte[] name, final byte[] value) throws IOException { print(","); if (indent) print(' '); if (!att) { print("{"); att = true; } print('"'); for (final byte ch : name) encode(ch); print("\":\""); for (final byte ch : value) encode(ch); print("\""); }
@Override protected void finishClose() throws IOException { print(']'); }
@Override protected void finishEmpty() throws IOException { finishOpen(); print(']'); }
@Override protected void finishOpen() throws IOException { if (att) print("}"); }