All pastes #215944 Raw Edit

Sans nom

public java v1 · immutable
#215944 ·published 2006-10-22 21:53 UTC
rendered paste body
    public static void copy(File source, File target) throws IOException {        BufferedInputStream input = new BufferedInputStream(new FileInputStream(source));        BufferedOutputStream output = new BufferedOutputStream(new FileOutputStream(target));        int bytesRead = 0;        byte[] buffer = new byte[1024];        while ((bytesRead = input.read(buffer, 0, buffer.length)) != -1) {            output.write(buffer, 0, bytesRead);        }        output.flush();        output.close();        input.close();    }