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);
  }
}

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 ) ; } }
reads bytes from the socket .
