Community Sites
Create your own community website and start earning today !
It's Free !
 
Communities Members BookmarksPolls Fresher Jobs Strange Photos Academic Projects New Member FAQ  



My Profile
Active Members
TodayLast 7 Days more...



Awards & Gifts
Online Exams

Fresher Jobs


Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi

Resources


Find educational articles, blogs, discussion threads and other resources.

Colleges


Find details about any college in India or search for courses.

website counter



Java Program-Copy file program


Posted Date: 18 Jun 2008    Resource Type: Articles/Knowledge Sharing    Category: Computer & Technology

Posted By: Girish Patil       Member Level: Diamond
Rating:     Points: 2



import java.io.*;

public class copyfile
{
public static void main(String args[])
{
try
{
FileInputStream fin;
FileOutputStream fout;
int i;
String source=args[0];
String target=args[1];
fin=new FileInputStream(source);
fout=new FileOutputStream(target);
do
{
i=fin.read();
if(i!=-1)
{
fout.write(i);
}
}
while(i!=-1);

fin.close();
fout.close();
}

catch(ArrayIndexOutOfBoundsException e)
{
System.out.println("format is : java file copy source target");
}
catch(FileNotFoundException e)
{
System.out.println("can not open file");
}
catch(IOException e)
{
System.out.println("can not read from file");
}
}
}







Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Java Program  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Java Program-Construtor overridding
Previous Resource: Java Program-Sort contents file
Return to Discussion Resource Index
Post New Resource
Category: Computer & Technology


Post resources and earn money!
 
Related Resources

Watch TV Channels



Contact Us    Editors    Privacy Policy    Terms Of Use   

SpiderWorks Technologies Pvt Ltd. 2006 - 2007 All Rights Reserved.