public void setReadTimeout (int timeout)

Sets the read timeout to a specified timeout, in milliseconds. A non-zero value specifies the timeout when reading from Input stream when a connection is established to a resource. If the timeout expires before there is data available for read, a java.net.SocketTimeoutException is raised. A timeout of zero is interpreted as an infinite timeout.

Some non-standard implementation of this method ignores the specified timeout. To see the read timeout set, please call getReadTimeout().

Parameters:
timeout    an int that specifies the timeout value to be used in milliseconds

Exceptions:
IllegalArgumentException    if the timeout parameter is negative

See also:
getReadTimeout(), InputStream.read()

Since:  1.5