| | |
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
android api appinventor apple applet application arc arguments array arrays automation binary bluetooth c++ chat class classes client code codesnippet compiler component csv database doctype draw ebook eclipse error event exception fractal freeze game givemetehcodez graphics gui html ide image input integer intellij iphone j2me java java.xls javaprojects jni jpanel julia linux list login loop loops mac map method methods mobile netbeans newbie number online oracle page parameter print problem program programming project recursion reporting rotatetext scanner screen server set size sms socket sort sourcelabs sql string superclass swing system template test testautomation threads time title tree tutorial-sample windows working






