public int read(byte []buf, int offset, int length)
    throws IOException
  {
    try {
      if (_s == null || _is == null)
        return -1;

      int readLength = _is.read(buf, offset, length);

      if (readLength >= 0)
        _totalReadBytes += readLength;

      return readLength;
    } catch (InterruptedIOException e) {
      if (_throwReadInterrupts)
        throw e;
      
      log.log(Level.FINEST, e.toString(), e);
    } catch (IOException e) {
      if (_throwReadInterrupts)
        throw e;

      log.log(Level.FINER, e.toString(), e);
    }

    return -1;
  }
public int read ( byte [ ] buf , int offset , int length ) throws IOException { try { if ( _s == null || _is == null ) return - 1 ; int readLength = _is . read ( buf , offset , length ) ; if ( readLength >= 0 ) _totalReadBytes += readLength ; return readLength ; } catch ( InterruptedIOException e ) { if ( _throwReadInterrupts ) throw e ; log . log ( Level . FINEST , e . toString ( ) , e ) ; } catch ( IOException e ) { if ( _throwReadInterrupts ) throw e ; log . log ( Level . FINER , e . toString ( ) , e ) ; } return - 1 ; }
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