• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

different betwean InputStream and FileInputStream

 
sam liya
Ranch Hand
Posts: 1240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the different betwean InputStream and FileInputStream?
why we use FileInputStream for Deserilization than InputStream
 
Rob Spoor
Sheriff
Pie
Posts: 20611
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic