| | |
Help needed to read and write files!
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Oct 2008
Posts: 25
Reputation:
Solved Threads: 0
How to make streams to read and write files (in binary) .
I have found a few Streams but do not know which one to use.
they are as follows:-
Please tell me which ones to use to reading and writing files.
Help will be highly appreciated.
I have found a few Streams but do not know which one to use.
they are as follows:-
Java Syntax (Toggle Plain Text)
PrintStream p=new PrintStream(new FileOutputStream("myfile.text")); DataInputStream in=new DataInputStream(new FileInputStream("myfile.txt")); BufferedReader br=new BufferedReader(new FileReader("myfile.text")); Printwriter pw=new PrintWriter(new FileWriter("myfile.text"));
Help will be highly appreciated.
Simple FileInputStream and FileOutputStream.
If you want to read in "binary" then there is no need to wrap those streams in anything else.
If you want to read in "binary" then there is no need to wrap those streams in anything else.
Last edited by masijade; Nov 14th, 2008 at 2:12 am.
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
![]() |
Similar Threads
- Help needed for project (Java)
- a non-destructive repartitioning tool? (*nix Software)
- Dynamic Array, Writing to CSV, Floating Point ?'s (C)
- Conserving resources and scrolling in files (C)
- Changing permission for www/html directory (Window and Desktop Managers)
- Perl/CGI (Saving Data) Part III (Computer Science)
- Reading data into files (C++)
- Linux Audio Streaming (live!) using Ices and Icecast (*nix Software)
- The Horse Power Of The Internet: The Newsgroups (Networking Hardware Configuration)
- Delete files on restart (Windows NT / 2000 / XP)
Other Threads in the Java Forum
- Previous Thread: Java realtime program on cellphone
- Next Thread: coding assistance
| Thread Tools | Search this Thread |
Tag cloud for Java
addressbook android api apple applet application arguments array arrays automation binary bluetooth button calculator chat class classes client code columns component converter database draw eclipse error errors event exception file fractal ftp game givemetehcodez graphics gridlayout gui helpwithhomework html ide image inetaddress input integer j2me japplet java javaprojects jme jmf jni jpanel julia link linux list loop map method methods midlethttpconnection mobile netbeans newbie number objects openjavafx oracle php print problem program programming project projects recursion rim scanner screen server set signing size smart sms socket sort sql storm string support swing test threads time tree unlimited variablebinding webservices windows






