private int readFromDataSource(byte[] target,int offset,int length,int bytesAlreadyRead,boolean allowEndOfInput) throws InterruptedException, IOException {
  if (Thread.interrupted()) {
    throw new InterruptedException();
  }
  int bytesRead=dataSource.read(target,offset + bytesAlreadyRead,length - bytesAlreadyRead);
  if (bytesRead == C.RESULT_END_OF_INPUT) {
    if (bytesAlreadyRead == 0 && allowEndOfInput) {
      return C.RESULT_END_OF_INPUT;
    }
    throw new EOFException();
  }
  return bytesAlreadyRead + bytesRead;
}

private int readFromDataSource ( byte [ ] target , int offset , int length , int bytesAlreadyRead , boolean allowEndOfInput ) throws InterruptedException , IOException { if ( Thread . interrupted ( ) ) { throw new InterruptedException ( ) ; } int bytesRead = dataSource . read ( target , offset + bytesAlreadyRead , length - bytesAlreadyRead ) ; if ( bytesRead == C . RESULT_END_OF_INPUT ) { if ( bytesAlreadyRead == 0 && allowEndOfInput ) { return C . RESULT_END_OF_INPUT ; } throw new EOFException ( ) ; } return bytesAlreadyRead + bytesRead ; }
starts or continues a read from the data source .
