aspose file tools*
The moose likes Beginning Java and the fly likes InputStream,how to use Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "InputStream,how to use" Watch "InputStream,how to use" New topic
Author

InputStream,how to use

linus dale
Ranch Hand

Joined: Jul 01, 2009
Posts: 44


why is this line correct
i is of class InputStream,how can it become object of FileInputStream

generally we write

or



Also is there a class like FileInputStreamReader
or FileInputStreamWriter
or FileOutputStreamReader
or FileOutputStreamWriter






Ulises Pulido
Ranch Hand

Joined: Jul 24, 2008
Posts: 81
Is correct because InputStream is a superclass of FileInputStream.

You can assign directly a reference of a child class to a parent class.


As far as I know there are not such classes you are asking for

But there are FileReader and FileWriter.


SCJP 5.0, SCWCD 5.0, SCBCD 5.0, SCJD, SCEA in progress
www.ulisespulido.com
linus dale
Ranch Hand

Joined: Jul 01, 2009
Posts: 44
Ulises Pulido wrote:Is correct because InputStream is a superclass of FileInputStream.

You can assign directly a reference of a child class to a parent class.


As far as I know there are not such classes you are asking for

But there are FileReader and FileWriter.



thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: InputStream,how to use