Re: Java equivalent of cin

From: Randolf Richardson (rr_at_8x.ca)
Date: 02/03/05


Date: Thu, 03 Feb 2005 18:30:07 GMT


"Wiseguy <noone@all.com>" wrote in comp.lang.java:

> "Sharp" <Sharp@SharpAddress.com> wrote in news:YIBId.129830$K7.120029
> @news-server.bigpond.net.au:
>
>>> Are you looking for something like?
>>>
>>> byte [] b=new byte[255];
>>> System.in.read(b);
>>>
>>> I strongly recommend that you download the J2SDK HTML documentation
>>> and put in on your machine. You then have the complete class
>>> heirarchy reference available to view at will.
>>
>> That doesn't seem too efficient
>
> As opposed to what? Use of a fixed length buffer? explicit necessity to
> type cast the result to some other type?...what then?

            Perhaps "java.io.BufferedReader" might address the efficiency concern?
I wonder if "Sharp" needs to read line-by-line.

> IMHO, streams under java are ugly to begin with.

            Streams aren't the only thing, but then again there are many ugly
things in many languages. I think Java's Generics are even uglier, but they
will prove to be very beneficial in the long run.

-- 
Randolf Richardson, pro-active spam fighter - rr@8x.ca
Vancouver, British Columbia, Canada
Sending eMail to other SMTP servers is a privilege.