Here we are showing how to convert an InputStream to File.
To do so first read the file as InputStream using FileInputStream. Create FileOutputStream class object to retrieve the file from system for modification then convert the InputSteam into byte array before writing into file then pass this array to the input stream and finally the byte array into file. Now all the data from InputStream is written into the desired file.
The code of the program is given below:
The output of the program is given below:
File is created.......................
Rs. 20,000 US$ 300
Today: Rs. 10,000 US$150
Course Duration: 30 hrs
Posted on: June 21, 2007 If you enjoyed this post then why not add us on Google+? Add us to your Circles