New Member FAQ
|
Forums
|
Earn Revenue
|
Distance Education
|
Help Topics
|
Admissions 2013
Awards & Gifts
Login
Register
Articles
Practice Tests
Ask Experts
Question Papers
Jobs
Universities
Colleges
Courses
Schools
Gift Shop
|
Bookmarks
|
Reviews
|
Learn English
|
Social Hub
|
Training
|
New Posts
|
My India
|
Members
|
Polls
|
Active Members
Today
pravin a marka...
(100)
chintan
(65)
R Pramod
(60)
Last 7 Days
R Pramod
(866)
K Mohan
(679)
yash
(534)
more...
Join our online
Google+ community
for Bloggers, Content Writers and Webmasters
Resources
»
Articles/Knowledge Sharing
»
Computer & Technology
Java Program-Copy file program
Posted Date:
18-Jun-2008
Category:
Computer & Technology
Author:
Girish Patil
Member Level:
Diamond
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");
}
}
}
Did you like this resource? Share it with your friends and show your love!
Tweet
Responses to "Java Program-Copy file program"
No responses found. Be the first to respond...
Feedbacks
Post Comment:
Notify me by email when others post comments to this article.
Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
No HTML formatting and links to other web sites are allowed.
This is a strictly moderated site. Absolutely no spam allowed.
Name:
Sign In
to fill automatically.
Email:
(Will not be published, but
required
to validate comment)
Type the numbers and letters shown on the left.
Next Resource:
Java Program-Construtor overridding
Previous Resource:
Java Program-Sort contents file
Return to Resources
Post New Resource
Category:
Computer & Technology
Post resources and
earn money
!
More Resources
Java Program-For stack
Java Program-Array Manipulation
Java Program-Matrix Manipulation
C Program for Odd numbers upto100
C Program for finding Grade
C Program for EB Bill
Popular Tags
Tag posting guidelines
Search Tags
Java Program
.
Subscribe to Email
Get Jobs by Email
Forum posts by Email
Articles by Email
Online Members
Vineeta Sinha
Himanshu Rawat
jatin
Ritu Agarwal
Ramprasad
ARJUN
gaurav aneja
pawan
udayasaran
Lakshmi Narayan
J KALIDAS
More...
About Us
Contact Us
Copyright
Privacy Policy
Terms Of Use
AdSense Revenue Sharing sites
Advertise
Talk to
Tony John
ISC Technologies, Kochi - India. Copyright © All Rights Reserved.