• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Marcus's tutorial on I/O

 
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi ,
In the marcus tutorial of java io he asked a question at last
Which of the following statements are true?
1) Java uses a system called UTF for I/O to support international character sets
2) The RandomAccessFile is the most suitable class for supporting international character sets
3) An InputStream class may not be chained to an OutputClass
4) File I/O activities requires use of Exception trapping

and given answer is 1,3,4. i have question on answer '3'.
In the explanation of answer he said :


InputStreams can only be chained to other OutputStreams and OutputStreams can only be chained to other OutputStreams.


I think he wants to say InputStreams can only be chained to other InputStreams and �... please correct me if I am wrong.
Please help me.
vivek
 
Vivek Shrivastava
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please someone come forward. i am looking forward to hear from u.
thanks in advance.
vivek
 
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
vivek,
Yes. You are correct. I think Marcus made a typo here.
There is ONLY ONE exception to the above statement as you may know it already. The exception IO class is PipedInputStream which can be connected to a PipedOutputStream which again is another OutputStream and the same info holds true for PipedOutputStream which again takes a PipedInputStream as argument in its constructor.
Since except this one class ALL other IO InputStream class types can be connected to only other SAME/Lowlevel InputStream types we can almost say the above (to be corrected by Marcus) statement by Marcus as a generalized statement.
regds
maha anna
From Java API
------------
PipedInputStream(PipedOutputStream src)
Creates a PipedInputStream so that it is connected to the piped output stream src.

[This message has been edited by maha anna (edited July 19, 2000).]
 
arch rival
Posts: 2813
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes that was a typo, I have fixed it now. Thanks for bringing that up especially the bit about piped inputstream.
Marcus
 
Vivek Shrivastava
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks maha and marcus.
regards
vivek
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic