/** * @param o The object to convert to JSON * @param indentSize The number of space characters to use as an indent (default 2). 0=newlines * but no spaces, -1=no indent at all. * @return */ public static String toJSON(Object o, int indentSize) { CharArr out = new CharArr(); new JSONWriter(out, indentSize).write(o); return out.toString(); }
public static String toJSON(Object o) { CharArr out = new CharArr(); new JSONWriter(out).write(o); return out.toString(); }