File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Quession obout constructor fo FilterInputStream Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Quession obout constructor fo FilterInputStream" Watch "Quession obout constructor fo FilterInputStream" New topic
Author

Quession obout constructor fo FilterInputStream

Hades Pan
Ranch Hand

Joined: Nov 25, 2001
Posts: 106
which is possible parameter that can be passed into the construcor
of a FilterInputStream
FilterInputStream(InputStream in)
a.File b.PrintStream c.FileOutputStream
d.FileInputStream e.RandomAccessFile
Ans is "d"
I see it in API is FilterInputStream(InputStream in)
Why "a" is not right?
kinnu jemmy
Greenhorn

Joined: Oct 08, 2001
Posts: 18
File is not a subclass of InputStream.that is the reason.
hope this helps.
Hades Pan
Ranch Hand

Joined: Nov 25, 2001
Posts: 106
OH thanks~1
AudioInputStream, ByteArrayInputStream, FileInputStream, FilterInputStream, InputStream, ObjectInputStream, PipedInputStream, SequenceInputStream, StringBufferInputStream is all of InputStream's subclass in API 1.3
And can we say all of above can be passed into the construcor
of a FilterInputStream?

regard
Hades
kinnu jemmy
Greenhorn

Joined: Oct 08, 2001
Posts: 18

i think it can be done.
quote from api about FilterInuputStream.
A FilterInputStream contains some other input stream, which it uses as its basic source of data, possibly transforming the
data along the way or providing additional functionality.
 
Consider Paul's rocket mass heater.
 
subject: Quession obout constructor fo FilterInputStream