aspose file tools*
The moose likes I/O and Streams and the fly likes io basic question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "io basic question" Watch "io basic question" New topic
Author

io basic question

Rakesh Bagaria
Greenhorn

Joined: Sep 06, 2009
Posts: 14
when we have FileInputStream Class for input purpose then why we need DataInputStream ?please Explain
pete stein
Bartender

Joined: Feb 23, 2007
Posts: 1561
Rakesh Bagaria wrote:when we have FileInputStream Class for input purpose then why we need DataInputStream ?please Explain


They're different beasts, and the API tells you why. The first is for getting bytes out of files, and often this is wrapped in another IO class such as a DataInputStream to get primitives out of the file, or ObjectInputStream to get objects out, or Readers to get text, or...

While the latter is to get primitives out of a stream, any stream be it a FileInputStream, or a Stream from any other source.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: io basic question