[3973] in java-interest

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

Re: InputStream.available()

daemon@ATHENA.MIT.EDU (Suen Chun Kiat)
Wed Dec 6 02:35:29 1995

Date: Wed, 06 Dec 1995 00:44:33 -0500
To: Martin Freeman <martin@PRPA.Philips.COM>
From: Suen Chun Kiat <cs59@cornell.edu>
Cc: java-interest@java.sun.com

>In the known bugs section of the beta release there is mention that in
>java.io for Windows 95 and NT that InputStream.available() doesn't
>work for non-file streams. I can attest to this. Does anyone know of
>a work-around for this for network I/O?

One way, which I have tried ( which I must admit is not a very elegant way)
is to create a thread to handle each of the network streams you have. These
threads basically waits for input and places the input that they have read
into some data structure within itself which can be accessed by the main thread.

Good luck.

Rgds,
Lawrence Suen

-----------------------------
Visit Suen's World at 'http://sck.resnet.cornell.edu'

Quote of the month ... 
'Cogito, ergo sum.'
(English translation) 'I think, therefore I am' -- Descartes, 
18th century philosopher


-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

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