• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

FilterInputStream chaining

 
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
FilterInputStream chaining, or concatenation may best be defined as the:
a) Ability to open a high level input stream on a lower level input stream
b) Ability to redirect the output of one stream to the input of another //t
c) Ability for the constructor of one stream to call that of another
d) Ability to sequentially open a collection of streams
 
josephine chen
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am not sure with this one???
 
Desperado
Posts: 3226
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
(A) Is the best answer if they want only one.
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is one of those questions Tony and I disagree on. I think B is best. The problem I have with A is that it's possible to chain two or more high-level streams together in addition to a low-level stream, and A doesn't cover that at all.
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I thought I read somewhere once that only the piped streams allowed direct chaining of the input to the output streams. Is this incorrect?
 
Jim Yingst
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, that's correct. But B isn't actually talking about an InputStream and an OutputStream; it's talking about different ways to look at a stream - the input side and the output side. It's all a matter of perspective. An InputStream takes its input from some other source, and "outputs" it as the return values for read() methods. This output can be used as input by another InputStream, which calls read() on the first stream to "input" info, and then "outputs" info as return values to its own read() statements.
Similarly, an OutputStream takes whatever data is passed in a write() statement as its "input", and then "outputs" data to whatever the stream is connected to on the other end. If that's another OutputStream, then the output of the first stream is sent as input to the second stream via the second stream's write() statements.
I know this is confusing use of terminology, but it still seems the most applicable choice for describing FilterInputStream chaining. (Even though none of the answers address the "filter" part of it.)
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I see your point of view. I'm still inclined to agree with Tony however that a is the best answer. I guess what really concerns me is the ambiguity of the question if both you and Tony can't agree on one best answer. I hope the certification exam is more straightforward. Regards, Joe
 
Tony Alicea
Desperado
Posts: 3226
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It will be
 
reply
    Bookmark Topic Watch Topic
  • New Topic