This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes IO Streams to use Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "IO Streams to use" Watch "IO Streams to use" New topic
Author

IO Streams to use

Clivant Yeo
Ranch Hand

Joined: May 22, 2004
Posts: 124
Hi ranchers,

Regarding the use of IO Streams, which stream should I use? Is DataInputStream and DataOutputStream a compulsory?

Thanks.


Clivant Yeo
My Personal Website
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11490
    
  95

Hi Clivant,

DataInputStream and DataOutputStream are not compulsory - you can use any classes you like. Since you will be updating individual records in the file, you may want to look at RandomAccessFile which can be used for both reading and writing.

You should check your instructions for any mention of NIO. Some of the latest instructions specify that NIO may not be used. But if you don't have any such instruction, then you may use NIO if you like.

Regards, Andrew


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Clivant Yeo
Ranch Hand

Joined: May 22, 2004
Posts: 124
Thanks Andrew, I note your point.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: IO Streams to use