• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to learn Stream classes in IO  RSS feed

 
Ranch Hand
Posts: 151
1
Eclipse IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want to learn the IO stream classes but I find it difficult to learn. As I don't know which lower level class must be used with which higher level class. Kindly guide me how to learn all this. Please help!!!

Kind Regards.
 
Sheriff
Posts: 11494
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A good place to start would be the Java Tutorials
 
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The most fundamental two classes are java.io.InputStream and java.io.OutputStream. InputStream is for reading bytes from some source; OutputStream is for writing bytes to some destination.

These classes have a number of subclasses for reading from and writing to specific sources and destinations, such as FileInputStream and FileOutputStream to read from and write to files. There are also subclasses that support specific data formats, such as ObjectInputStream and ObjectOutputStream which can read and write arbitrary Java objects in a binary format. There are also subclasses that add certain functionality, such as BufferedInputStream and BufferedOutputStream which add buffering, which makes I/O from or to for example a harddisk more efficient.

On top of InputStream and OutputStream, you have two other fundamental classes: Reader and Writer. These are for reading and writing text. They convert from bytes to characters and vice versa using a character encoding. Use the subclasses of Reader and Writer for reading and writing text.

Have a look at the tutorial that Junilu posted a link to, and have a look at the API documentation of the package java.io.
 
Abhimanyu Jain
Ranch Hand
Posts: 151
1
Eclipse IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so much sir!!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!