MCPcopy
hub / github.com/arduino/Arduino / copyFile

Method copyFile

arduino-core/src/processing/app/helpers/FileUtils.java:50–65  ·  view source on GitHub ↗
(File source, File dest)

Source from the content-addressed store, hash-verified

48 }
49
50 public static void copyFile(File source, File dest) throws IOException {
51 FileInputStream fis = null;
52 FileOutputStream fos = null;
53 try {
54 fis = new FileInputStream(source);
55 fos = new FileOutputStream(dest);
56 byte[] buf = new byte[4096];
57 int readBytes = -1;
58 while ((readBytes = fis.read(buf, 0, buf.length)) != -1) {
59 fos.write(buf, 0, readBytes);
60 }
61 } finally {
62 IOUtils.closeQuietly(fis);
63 IOUtils.closeQuietly(fos);
64 }
65 }
66
67 public static void copy(File sourceFolder, File destFolder) throws IOException {
68 for (File file : sourceFolder.listFiles()) {

Callers 4

updateCacheFileMethod · 0.95
downloadFileMethod · 0.95
copyMethod · 0.95
setupMethod · 0.95

Calls 2

readMethod · 0.45
writeMethod · 0.45

Tested by 1

setupMethod · 0.76