No, as far as I know, a blocking read() blocks forever, if there is no data available, but the end of stream has not been reached. You can't have a time-out. You can't interrupt it. Closing the stream, from another thread, might work for some types of stream, but if it does work, it's an undocumented and unreliable feature. Rubbish, ain't it?!
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Nope, HttpUrlConnection is maddening that way. Some ideas ...
The Apache Commons HTTPClient package has a compatible class with timeout.
Pass a reference to the HttpUrlConnection to a Timer task. When the timer task fires, make it close the connection. That will cause an exception in the original thread. If you're not familiar with that kind of threading just holler - we can provide some more detail.
Using Timer and your own threads is discouraged in EJB servers. I made an HTTPSocket class that extends HttpUrlConnection (because there's no interface, dang it!) and overrode the methods I needed to implement the HTTP protocol. Socket has a timeout parameter. Implementing HTTP turned out to be no fun, and I didn't have the nerve to put the thing in production.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi