[623] in java-interest

home help back first fref pref prev next nref lref last post

Re: available() always returns 0?

daemon@ATHENA.MIT.EDU (Gary Joseph Bowdridge)
Sat Jul 8 21:17:24 1995

From: grover@ra.isisnet.com (Gary Joseph Bowdridge)
To: java-interest@java.Eng.Sun.COM
Date: Sat, 8 Jul 1995 06:30:19 -0300 (ADT)

Forwarded message:
> From cmcmanis@scndprsn.Eng.Sun.COM Thu Jul  6 14:31 ADT 1995
> Date: Thu, 6 Jul 1995 10:35:24 -0700
> From: cmcmanis@scndprsn.Eng.Sun.COM (Chuck McManis)
> Message-Id: <9507061735.AA20587@pepper.Eng.Sun.COM>
> To: grover@ra.isisnet.com
> Subject: Re: available() always returns 0?
> X-Sun-Charset: US-ASCII
> Content-Type: text
> Content-Length: 203
> 
> InputStream is an abstract class, other classes like FileInputStream (a
> subclass of InputStream) will override available() to do the "right" thing.
> See the api documentation of package java.io
> 
> 
> --Chuck
> 

  Which is fine if you're reading from the one InputStream in which it
is implemented (FileInputStream)...  All the other input filters
(that i have found) use the "available" method in the InputStream class...

  Now.. With no working "available" for the NetworkClient class.
and with no *obvious* way to do non-blocking reads in the same class
(or any other that i can see), i am left with NO way to read
from a NetworkClient stream where there may be no input waiting 
to be read... unless i want to hang on my read...

   I presume the standard solution is to start another thread for the
read...  which is where java looses me... Can sumone give me a tiny
example of a class that implements a new thread for doing a read
on ANY inputStream?  Thanks... or not...

___
grover@ra.isisnet.com

-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post