- /**
- * simple copy image,
- * @param src
- * @param dest
- */
- byte[] buffer = new byte[1024];
- FileInputStream r = null;
- FileOutputStream w = null;
- int r_num=0;
- try{
- r_num = r.read(buffer, 0, 1024);
- while(r_num != -1){
- w.write(buffer, 0, r_num);
- r_num = r.read(buffer, 0, 1024);
- }
- }
- e.printStackTrace();
- }
- finally{
- try{
- if(r != null)
- r.close();
- if(w != null)
- w.close();
- }
- ex.printStackTrace();
- }
- }
- }
可用於任何byte-oriented file, ex: image