Guest User

Untitled

a guest
Jul 19th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. File directory = getDir("template", Context.MODE_PRIVATE);
  2.  
  3. private boolean copyFile(File src,File dst)throws IOException{
  4. if(src.getAbsolutePath().toString().equals(dst.getAbsolutePath().toString())){
  5.  
  6. return true;
  7.  
  8. }else{
  9. InputStream is=new FileInputStream(src);
  10. OutputStream os=new FileOutputStream(dst);
  11. byte[] buff=new byte[1024];
  12. int len;
  13. while((len=is.read(buff))>0){
  14. os.write(buff,0,len);
  15. }
  16. is.close();
  17. os.close();
  18. }
  19. return true;
  20. }
Add Comment
Please, Sign In to add comment