Meaningless Drivel is fun!*
The moose likes I/O and Streams and the fly likes different betwean InputStream and FileInputStream 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 » Java » I/O and Streams
Bookmark "different betwean InputStream and FileInputStream" Watch "different betwean InputStream and FileInputStream" New topic
Author

different betwean InputStream and FileInputStream

sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1206
what is the different betwean InputStream and FileInputStream?
why we use FileInputStream for Deserilization than InputStream
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19723
    
  20

A FileInputStream is a specialized InputStream that only works with files.

InputStream itself is more general - besides FileInputStream, you can also retrieve InputStreams to read from URLs (through java.net.URL and java.net.URLConnection), databases (through java.sql.ResultSet), or in theory every source of data.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: different betwean InputStream and FileInputStream