MCPcopy Index your code
hub / github.com/processing/processing / copyFile

Method copyFile

app/src/processing/app/Util.java:127–147  ·  view source on GitHub ↗
(File sourceFile,
                              File targetFile)

Source from the content-addressed store, hash-verified

125
126
127 static public void copyFile(File sourceFile,
128 File targetFile) throws IOException {
129 BufferedInputStream from =
130 new BufferedInputStream(new FileInputStream(sourceFile));
131 BufferedOutputStream to =
132 new BufferedOutputStream(new FileOutputStream(targetFile));
133 byte[] buffer = new byte[16 * 1024];
134 int bytesRead;
135 while ((bytesRead = from.read(buffer)) != -1) {
136 to.write(buffer, 0, bytesRead);
137 }
138 from.close();
139 from = null;
140
141 to.flush();
142 to.close();
143 to = null;
144
145 targetFile.setLastModified(sourceFile.lastModified());
146 targetFile.setExecutable(sourceFile.canExecute());
147 }
148
149
150 /**

Callers 4

copyDirMethod · 0.95
addFileMethod · 0.95
handleOpenInternalMethod · 0.95
exportApplicationMethod · 0.95

Calls 5

setLastModifiedMethod · 0.80
writeMethod · 0.65
readMethod · 0.45
closeMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected