MCPcopy Index your code
hub / github.com/java-native-access/jna / copy

Method copy

test/com/sun/jna/LibraryLoadTest.java:143–157  ·  view source on GitHub ↗
(File src, File dst)

Source from the content-addressed store, hash-verified

141 }
142
143 private void copy(File src, File dst) throws Exception {
144 FileInputStream is = new FileInputStream(src);
145 FileOutputStream os = new FileOutputStream(dst);
146 int count;
147 byte[] buf = new byte[1024];
148 try {
149 while ((count = is.read(buf, 0, buf.length)) > 0) {
150 os.write(buf, 0, count);
151 }
152 }
153 finally {
154 try { is.close(); } catch(IOException e) { }
155 try { os.close(); } catch(IOException e) { }
156 }
157 }
158
159 public void testLoadLibraryWithUnicodeName() throws Exception {
160 File tmpdir = Native.getTempDir();

Calls 3

readMethod · 0.65
closeMethod · 0.65
writeMethod · 0.45

Tested by

no test coverage detected