Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

How to learn Stream classes in IO

 
Ranch Hand
Posts: 151
1
Eclipse IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 16631
278
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A good place to start would be the Java Tutorials
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you so much sir!!
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic