Thread: I Need Help!
View Single Post
  #3 (permalink)  
Old 02-02-2008, 02:29 AM
jelly's Avatar
jelly jelly is offline
Member
 
Join Date: Jan 2008
Location: Somerset, UK
Posts: 46
jelly is on a distinguished road
or using nio

Code:
public static void main(String[] args) { FileChannel in = null, out = null; try { in = new FileInputStream(args[0]).getChannel(); out = new FileOutputStream(args[1]).getChannel(); out.transferFrom(in, 0, in.size()); } catch (IOException e) { e.printStackTrace(); } finally{ try{ if (in != null) {in.close();} if (out != null) {out.close();} } catch (IOException ioe) { // just eat the exception } } }
__________________
-- Hope that helps

Last edited by jelly : 02-02-2008 at 02:31 AM.
Reply With Quote