• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Quession obout constructor fo FilterInputStream

 
Hades Pan
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
File is not a subclass of InputStream.that is the reason.
hope this helps.
 
Hades Pan
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic