wood burning stoves*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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.
 
 
subject: Quession obout constructor fo FilterInputStream
 
Similar Threads
Read method in IO
FilterInputStream
InputStream
FilterInputStreams
scjp (DataInputStream)