(Object o)
| 241 | if (o == null) return new byte[0]; |
| 242 | CharArr out = new CharArr(); |
| 243 | new JSONWriter(out, JSONWriter.DEFAULT_INDENT).write(o); // indentation by default |
| 244 | return toUTF8(out); |
| 245 | } |
| 246 | |
| 247 | /** |
| 248 | * @param indentSize The number of space characters to use as an indent. 0=newlines but no spaces, |
| 249 | * -1=no indent at all. |
| 250 | */ |
| 251 | public static byte[] toJSON(Object o, int indentSize) { |