@Override public int read(byte[] buf,int offset,int length) throws IOException {
  try {
    if (_is == null) {
      if (_s == null) {
        return -1;
      }
      _is=_s.getInputStream();
    }
    int readLength=_is.read(buf,offset,length);
    if (readLength >= 0) {
      _totalReadBytes+=readLength;
    }
    return readLength;
  }
 catch (  InterruptedIOException e) {
    e.printStackTrace();
    if (_throwReadInterrupts)     throw e;
    log.log(Level.FINEST,e.toString(),e);
  }
catch (  IOException e) {
    e.printStackTrace();
    if (_throwReadInterrupts) {
      throw e;
    }
    if (log.isLoggable(Level.FINEST)) {
      log.log(Level.FINEST,e.toString(),e);
    }
 else {
      log.finer(e.toString());
    }
  }
  return -1;
}

@ Override public int read ( byte [ ] buf , int offset , int length ) throws IOException { try { if ( _is == null ) { if ( _s == null ) { return - 1 ; } _is = _s . getInputStream ( ) ; } int readLength = _is . read ( buf , offset , length ) ; if ( readLength >= 0 ) { _totalReadBytes += readLength ; } return readLength ; } catch ( InterruptedIOException e ) { e . printStackTrace ( ) ; if ( _throwReadInterrupts ) throw e ; log . log ( Level . FINEST , e . toString ( ) , e ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; if ( _throwReadInterrupts ) { throw e ; } if ( log . isLoggable ( Level . FINEST ) ) { log . log ( Level . FINEST , e . toString ( ) , e ) ; } else { log . finer ( e . toString ( ) ) ; } } return - 1 ; }
reads bytes from the socket .
