code: public int readTimeout(byte []buf, int offset, int length, long timeout)
      throws IOException
    {
      if (_s == null || _is == null)
        return -1;
  
      int oldTimeout = _s.getSoTimeout();
  
      try {
        _s.setSoTimeout((int) timeout);
  
        int readLength = read(buf, offset, length);
  
        return readLength;
      } finally {
        _s.setSoTimeout(oldTimeout);
      }
    }
docs: Reads bytes from the socket.
  
  @param buf byte buffer receiving the bytes
  @param offset offset into the buffer
  @param length number of bytes to read
  @return number of bytes read or -1
  @exception throws ClientDisconnectException if the connection is dropped