private int readFromResponse(State state,InnerState innerState,byte[] data,InputStream entityStream) throws StopRequest {
  try {
    return entityStream.read(data);
  }
 catch (  IOException ex) {
    logNetworkState();
    mInfo.mCurrentBytes=innerState.mBytesSoFar;
    mDB.updateDownload(mInfo);
    if (cannotResume(innerState)) {
      String message="while reading response: " + ex.toString() + ", can't resume interrupted download with no ETag";
      throw new StopRequest(DownloaderService.STATUS_CANNOT_RESUME,message,ex);
    }
 else {
      throw new StopRequest(getFinalStatusForHttpError(state),"while reading response: " + ex.toString(),ex);
    }
  }
}

private int readFromResponse ( State state , InnerState innerState , byte [ ] data , InputStream entityStream ) throws StopRequest { try { return entityStream . read ( data ) ; } catch ( IOException ex ) { logNetworkState ( ) ; mInfo . mCurrentBytes = innerState . mBytesSoFar ; mDB . updateDownload ( mInfo ) ; if ( cannotResume ( innerState ) ) { String message = "while reading response: " + ex . toString ( ) + ", can't resume interrupted download with no ETag" ; throw new StopRequest ( DownloaderService . STATUS_CANNOT_RESUME , message , ex ) ; } else { throw new StopRequest ( getFinalStatusForHttpError ( state ) , "while reading response: " + ex . toString ( ) , ex ) ; } } }
read some data from the http response stream , handling i / o errors .
