/** * Kopiert ein file mittels Steam (Schnelle Mehtode). * * @param source * @param dest * @throws IOException */ private void copyFileUsingStream(File source, File dest) throws FileNotFoundException, IOException { // TODO LaufId impl. File tmp = File.createTempFile(laufId, ".tmp", dest.getParentFile()); byte[] buffer = new byte[1024]; int len; FileInputStream fis = new FileInputStream(source); BufferedInputStream bis = new BufferedInputStream(fis); FileOutputStream fos = new FileOutputStream(tmp); BufferedOutputStream bos = new BufferedOutputStream(fos); while ((len = bis.read(buffer)) > -1) { bos.write(buffer, 0, len); } bis.close(); fis.close(); bos.close(); fos.close(); tmp.renameTo(getUniqueFilename(dest)); }