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();

   }

 }