byte[] content = "Content is overrated".getBytes();
String filename = "C:/temp/hirsch." + lieferung.getFormat();
BufferedOutputStream bos = null;
try {
FileOutputStream fos = new FileOutputStream(new File(filename));
bos = new BufferedOutputStream(fos);
bos.write(content);
} catch (Exception e) {
LOG.error("Write Exception" , e);
} finally {
if (bos != null) {
try {
bos.flush();
bos.close();
} catch (Exception e) {
LOG.error("Close or Flush Exception" , e);
}
}
}
Keine Kommentare:
Kommentar veröffentlichen