日期:2014-05-20 浏览次数:20564 次
public int getThreadSize(long contentLength) { System.out.println("哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈"+ contentLength); int threadSize = 1; //线程数 BigDecimal contentBig = new BigDecimal(contentLength); BigDecimal bufferBig = new BigDecimal(bufferSize); BigDecimal CyclesBig = new BigDecimal(threadNumOfCycles); //threadNumOfCycles 线程循环次数 threadSize = contentBig.divide(bufferBig.multiply(CyclesBig), 0, //multiply 乘以 divide 分;BigDecimal 大小数 BigDecimal.ROUND_HALF_UP).intValue(); System.out.println("呵呵呵"+ threadSize); return threadSize; }