try {
FileOutputStream fos = new FileOutputStream(fileURL);
autoClose[0] = fos;
writer = createWriter(fos);
} catch (IOException e) {
throw new TxwException(e);
}
} else
throw new IllegalArgumentException();
// now delegate to the SaxSerializer
serializer = new SaxSerializer(writer,writer,false) {
public void endDocument() {
super.endDocument();
if(autoClose[0]!=null) {
try {
autoClose[0].close();
} catch (IOException e) {
throw new TxwException(e);
}
autoClose[0] = null;
}
}
};