private List<BatchInfo> createBatch(InputStream inputStream,List<BatchInfo> batchInfos,JobInfo jobInfo,BulkConnection bulkConnection){
  try {
    LOG.info("Creating batch for the test classes to execute using bulk connection....");
    BatchInfo batchInfo=bulkConnection.createBatchFromStream(jobInfo,inputStream);
    batchInfos.add(batchInfo);
  }
 catch (  AsyncApiException e) {
    ApexUnitUtils.shutDownWithDebugLog(e,"Encountered AsyncApiException Exception while trying to create batchInfo" + " using bulk connection. " + e.getMessage());
  }
 finally {
    try {
      inputStream.close();
    }
 catch (    IOException e) {
      ApexUnitUtils.shutDownWithDebugLog(e,"Encountered IO Exception while trying to close the input stream after " + "creating batchInfo using bulk connection. " + e.getMessage());
    }
  }
  return batchInfos;
}

private List < BatchInfo > createBatch ( InputStream inputStream , List < BatchInfo > batchInfos , JobInfo jobInfo , BulkConnection bulkConnection ) { try { LOG . info ( "Creating batch for the test classes to execute using bulk connection...." ) ; BatchInfo batchInfo = bulkConnection . createBatchFromStream ( jobInfo , inputStream ) ; batchInfos . add ( batchInfo ) ; } catch ( AsyncApiException e ) { ApexUnitUtils . shutDownWithDebugLog ( e , "Encountered AsyncApiException Exception while trying to create batchInfo" + " using bulk connection. " + e . getMessage ( ) ) ; } finally { try { inputStream . close ( ) ; } catch ( IOException e ) { ApexUnitUtils . shutDownWithDebugLog ( e , "Encountered IO Exception while trying to close the input stream after " + "creating batchInfo using bulk connection. " + e . getMessage ( ) ) ; } } return batchInfos ; }
create a batchinfo by using the inputstream consisting of classids .
