!BufferedWriter.class.isAssignableFrom(writerClass)) {
writer = new BufferedWriter(writer);
}
if (indentDepth > 0) {
serializer = new SerializerVerbose(writer, indentDepth);
} else {
serializer = new Serializer(writer);
}
try {
serializer.writeArray(this);