serializer = new SerializerVerbose(writer, indentDepth);
} else {
serializer = new Serializer(writer);
}
try {
serializer.writeObject(this).flush();
} catch (IOException iox) {
JSONException jex = new JSONException("Error occurred during write.");
jex.setCause(iox);
throw jex;
}