Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

difference between file and stream in IOStreams ?

 
siva chaitanya
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please explain me with an example
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15359
39
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See the API documentation of java.io.File and java.io.InputStream, java.io.OutputStream and subclasses.

Also see Lesson: Basic I/O in Oracle's Java Tutorials.
 
Campbell Ritchie
Sheriff
Pie
Posts: 49405
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just as important is the difference between data streams and readers, which you will also find mentioned in the Tutorial link Jesper gave you.
 
Angus Comber
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I assume you know what a file is?

A stream, as the name implies, is like a real stream. It is a flow of bytes.

The file may be the 'source' of a stream or the 'destination' of a stream.

You should look on the web generally for file io, redirection, stdin, stdout, stderr, piping, etc.
 
Ivan Jozsef Balazs
Rancher
Posts: 979
5
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Angus Comber wrote:
You should look on the web generally for file io, redirection, stdin, stdout, stderr, piping, etc.


All the world is but a stage, er, a file ;-)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic