[3356] in java-interest
Re: problem with URLConnection/InputStreams
daemon@ATHENA.MIT.EDU (Simon Spero)
Wed Nov 8 22:18:40 1995
Date: Wed, 8 Nov 1995 15:35:12 -0800 (PST)
From: Simon Spero <ses@tipper.oit.unc.edu>
To: Edd Dumbill <edmundd@compnews.co.uk>
cc: java-interest@java.sun.com
In-Reply-To: <Pine.SUN.3.91.951108141325.7386U-100000@sage.compnews.co.uk>
On Wed, 8 Nov 1995, Edd Dumbill wrote:
>
> The problem is that it works fine (most of the time - it has failed
> first time) , but then if I clone the applet from the appletviewer, the
> clone returns 0 from is.available(). The httpd access log shows that the
> information is being sent OK.
>
> So what am I doing wrong?
You're believing available() when you call it on something even vaguely
linked to a socket. Don't believe it - it's lying, I tell you :-)
The source code in SocketInputStream explains the problem:
--
/** not implemented for sockets, always returns zero. */
public int available() {
return(0);
}
--
Say hi to Phil Male for me
Simon
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com