System.in.read(), why use anything else?

the in() method of the class System is an InputStream (abstract class). it does have an instantiation of read() and it reads bytes. So why use something like StringReader() or ByteArrayInputReader(), wher you'd have to open up a stream and everything. To me it seems like this abstract class has quite a bit of functionality already. All the other subclasses that extends the InputStream class, is nice, but for just reading the command line is there any need to use anything other than just the default in.read()? Thanks.I think I am understanding streams a little better now.

[585 byte] By [deadseasquirrels] at [2007-9-27 20:41:06]
# 1
java.io is a byte stream or a char such asin.read()(char) intValue:97 up to 123 I think is the ascii char numbers in lower case. So, I think ?!? io in java isn't just a byte-stream.
Purple_Jane at 2007-7-7 1:58:20 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 2

> the in() method of the class System is an InputStream

> (abstract class). it does have an instantiation of

> read() and it reads bytes. So why use something like

> StringReader() or ByteArrayInputReader(), wher you'd

> have to open up a stream and everything. To me it

> seems like this abstract class has quite a bit of

> functionality already. All the other subclasses that

> extends the InputStream class, is nice, but for just

> reading the command line is there any need to use

> anything other than just the default in.read()?

> Thanks.I think I am understanding streams a little

> better now.

Here's a table from Sun's Java tutorial describing what some of these streams do and when you might want to use them:

http://java.sun.com/docs/books/tutorial/essential/io/datasinks.html

hungyee at 2007-7-7 1:58:20 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 3
You could read the command line that way, but likewise you could eat peas with a toothpick. It works, but a more capable tool like a spoon usually works better. That's why you'd use a BufferedReader or something like that.
DrClap at 2007-7-7 1:58:20 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 4
Where can I download an example of this "Spoon" you speak of?
ChrisBoy at 2007-7-7 1:58:20 > top of Java-index,Archived Forums,New To Java Technology Archive...