| | |
Help needed to read and write files!
![]() |
•
•
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 |
android api applet application apps array arrays automation awt bidirectional binary birt bluetooth businessintelligence busy_handler(null) card chat class classes client code collision columns component constructor database designadrawingapplicationusingjavajslider draw eclipse error errors eventlistener exception expand fractal free game givemetehcodez graphics gui guidancer html ide image inetaddress integer integration intellij j2me java javafx javamicroeditionuseofmotionsensor javaprojects jme jni jpanel jtree julia linux list loop machine map method methods migrate mobile mobiledevelopmentcreatejar myaggfun netbeans newbie oracle plazmic print problem program programming project recursion scanner server set sharepoint smart sms smsspam sort sortedmaps sql string subclass support swing textfield threads tree unlimited utility webservices windows






