aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Filteroutputstream 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 "Filteroutputstream" Watch "Filteroutputstream" New topic
Author

Filteroutputstream

Anju Rao
Ranch Hand

Joined: Feb 23, 2000
Posts: 43
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,
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
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.)


"I'm not back." - Bill Harding, Twister
Anju Rao
Ranch Hand

Joined: Feb 23, 2000
Posts: 43
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.
nkpriya
Greenhorn

Joined: Oct 24, 2000
Posts: 5
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
P SOLAIAPPAN
Ranch Hand

Joined: Oct 20, 2000
Posts: 68
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).]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Filteroutputstream