标签:java
1、文件上传
private static void copy(File src, File dst) throws IOException {
InputStream in = null;
OutputStream out = null;
in = new BufferedInputStream(new FileInputStream(src), BUFFER_SIZE);
out = new BufferedOutputStream(new FileOutputStream(dst), BUFFER_SIZE);
byte[] buffer = new byte[16 * 1024];
int len = 0;
while ((len = in.read(buffer)) > 0) {
out.write(buffer, 0, len);
}
if (null != in) {
in.close();
}
if (null != out) {
out.close();
}
}
标签:java
原文地址:http://ql0722.blog.51cto.com/4353164/1655402