Powered by Blogger.

2). Streams vs Reader & Writer

>> Friday, April 22, 2011

Streams

To Write the data into file OutputStreamReader and  to read the data from a file, the class InputStreamReader will be used.

InputStream classes are used to read the data.

OutputStream classes are used to write the data.

The above all defined classes are byte oriented classes

Reader & Writer

The Character oriented classes are the reader and writer classes.These are also defined in an IO Package.These are also the abstract classes.

FileReader class comes under the InputStreamReader class.

FileWriter class comes under the OutPutStreamWriter class.

To Identify the difference between Byte oriented classes and Character oriented class is..
 
  #1). If the class name ends with the word Stream then it is a Byte Oriented class

  #2). If the class name ends with the word Reader or Writer then it is a Character oriented class.

Related Posts Plugin for WordPress, Blogger...
© javabynataraj.blogspot.com from 2009 - 2014. All rights reserved.