• 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

Filteroutputstream

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ALL,
Following is the question from Barry boones:
You can attach a FilterOutputStream object to:
a) An underlying file
b) Another FilterOutputStream object,
c) A filterInputStream object
d) all of these.
I thought the answer was only b). But the answer is a,b. Only the FileInputstream can attach to an underlying file,so is this answer wrong?
Also, I want to understand the InputStream Reader, OutputStreamWriter classes - i am not finding them in the certification books. It just says "They convert between streams of Bytes and sequences of unicode characters". I didn't check the Marcus Site, but can anybody suggest me some reading material for this?
Thanks,
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think the answer is either b or d, depending on interpretation. Of the choices listed, you can only directly attach a FilterInputStream to another FilterInputStream. But indirectly, you can attach any of them, through other types of streams. For C, you'd need a PipedInputStream connected to a PipedOutputStream - which is more obscure than you need to worry about for certification I think, but it's possible. Since it's a poorly-worded question, I wouldn't worry about it. (But feel free to write Barry to let him know about the problem.)
 
Anju Rao
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Jim! I agree with u that it is badly worded. I also see now why they could have possible picked "a" as the answer.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
How we can know that what are the objects that can be attached to other object like eg:FilterOutputStream.
I think For FilterOutputStream there is only one constructor which takes the outputstream object.Is this related to above stmt.Can anyone explain this.
Thanks and Regards
Priya
 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,
The question given in the Barrey bone book is confusing.
The main confusion is:
a) An underlying file
FilterOutputStream takes only one constructor ie. OutputStream or its sub clsses. Filters can be combined, with one filter using the output of another as its input.
The question (a) should have been "FileOutputStream"
Then (a) is also correct. I thing, the book means that.
Since FileOutputStream is a subclass of OutPutStream it is ok.
(e.g)
BufferedOutputStream bos=new BufferedOutputStream(new FileOutputStream("test.txt"));
Two good certification books on I/O is
1. A PROGRAMMER'S GUIDE TO JAVA CERTIFICATION - K A Mughal& R W Ramussen
2. JAVA2 CERTIFICATION BY Jamie Jaworski
solaiappan


[This message has been edited by P SOLAIAPPAN (edited October 24, 2000).]
 
Acetylsalicylic acid is aspirin. This could be handy too:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic