![]() |
How to read and write files in Java I am creating a program where the code is able to read a user specified file and also capable of writing few lines in the same file. But how will this be possible using JAVA? How can I code Java for read and write functions? Can anyone explain me the working of this module? |
Re: How to read and write files in Java Code: import java.io.*; |
Re: How to read and write files in Java Here is the code for reading the from the file: Code: public void read(String myFile) throws IOException{ |
Re: How to read and write files in Java Here is what I found on SUN.com. To open a file for reading, you can use the newInputStream method. This method returns an unbuffered input stream for reading bytes from the file. Code: Path file = ...; |
All times are GMT +5.5. The time now is 11:51 AM. |