while ((bytesRead = input.read(buffer)) != -1) {
output.write(buffer, 0, bytesRead);
}
} catch (IOException e) {
// FIXME log
throw new FileFormatAdapterException(
"Unable to generate translated file", e);
} catch (SecurityException e) {
// FIXME log
throw new FileFormatAdapterException(
"Unable to generate translated file", e);
} finally {
if (tempFile != null) {
if (!tempFile.delete()) {
log.warn(