zizi21
asked on
Reading Text file/Binary File/Ascii file...
Hi,
For text files, we use Scanner reader=new Scanner(new File("output.txt")),
To write, we use PrintWriter pw=new PrintWriter(new FileWriter("test.txt"));
For random access file, we use RandomAccessFile rad=new RandomAccessFile("output.t xt",rw).
I am confused on two things..Pls help..
Random access files means we can randomly access the file. Regardless, whether it is text, binary, ascii ?? Is this correct ??
For binary files, what do we use to read and write...???Pls help...Thank you very much..
For text files, we use Scanner reader=new Scanner(new File("output.txt")),
To write, we use PrintWriter pw=new PrintWriter(new FileWriter("test.txt"));
For random access file, we use RandomAccessFile rad=new RandomAccessFile("output.t
I am confused on two things..Pls help..
Random access files means we can randomly access the file. Regardless, whether it is text, binary, ascii ?? Is this correct ??
For binary files, what do we use to read and write...???Pls help...Thank you very much..
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can use it on whatever file is available, but it is treated as a binary file, no crlf conversions and such stuff.
ASKER
thanks, on the next question : For binary files, what do we use to read and write ?
For the ascii files, could i use the same method for read and write too??
For the ascii files, could i use the same method for read and write too??
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER