creating, editing, modifying,viewing files

Reply

Join Date: Aug 2009
Posts: 36
Reputation: and12 has a little shameless behaviour in the past 
Solved Threads: 0
and12 and12 is offline Offline
Light Poster

creating, editing, modifying,viewing files

 
0
  #1
Aug 29th, 2009
I want to create a program where i can create data files, either in text, binary: data or objects. Once the data files are created by the user they can be used to view them in all modes. They should view existing data files in the current or sub directory by having a drop down select list (but i don't know if Java can do a "dir" command).
I also want the view part to be able to tell what type of file it is. So i would be able to open the correct stream (DataInputStream, ObjectInputStream, etc.).
It would be nice to see how they look in all three views too.
If it's in binary, i still want to be able to see it text view to see what the contents are.
Also, i would like to convert text to binary and binary to text.

I would appreciate some tips for anyone who has tried any of the above.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 121
Reputation: puneetkay is on a distinguished road 
Solved Threads: 23
puneetkay's Avatar
puneetkay puneetkay is offline Offline
Junior Poster

Re: creating, editing, modifying,viewing files

 
1
  #2
Aug 29th, 2009
Hello,

Study on File , ByteArrayInputStream, ByteArrayOutputStream, DataInputStream and DataOutputStream classes of java.io package. This is all you have to do. If you do a smart search, You will get code for this program as its really common.

use listFiles() method of java.io.File class to get list of all files in a specific folder.

For more info on java.io package

Regards,
Puneet Kalra
www.PuneetK.com
Sun Certified Java Programmer


Admin of Pikk - Object Relational Mapping Framework
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC