public static void multipartUploadObejctByMultithreading(KS3Client client,InputStream inputstream, 
			int offset,String bucketName,String objectKey,String mimeType) throws Exception{
		
		// 偏移量不能为负数
		if (offset < 0)
			throw new IllegalArgumentException("Illegal offset.");
		
		// 处理偏移量
		try {
			inputstream.skip(offset);
		} catch (Exception e) {
			e.printStackTrace();
			throw new Exception("Skip data failed.");
		}

		// 初始化一个指定数量线程的线程池，并构造一个线程安全到list承载上传列表的相关信息
		ExecutorService threadPool = Executors.newFixedThreadPool(CONCURRENCIES);
		List<UploadPart> partList = Collections.synchronizedList(new ArrayList<UploadPart>());

		// 初始化一个上传会话
		InitiateMultipartUploadResult imur = client.initiateMultipartUpload(bucketName, objectKey,mimeType);
		String uploadId = imur.getUploadId();	
		
		AbortMultipartUploadOptions abortMultipartUploadOptions = new AbortMultipartUploadOptions(bucketName, objectKey, uploadId);

		// 定义变量
		int partCount = 0;
		int currentSize = 0;
		boolean isLastPart = false;
		
		// 一直读，知道读到数据源结尾为止
		while(true){
			
			InputStream inputstreamPart = null;
			currentSize = BUFFER_SIZE;
			
			try {
				inputstreamPart = getInputStreamPart(inputstream);
				
			} catch (EndOfStreamException e) {
				
				int dataLength = e.getBufferSize();
				if(dataLength==0)
					break;// 说明上一块正好读完，这块是空的,直接break
				else{
					isLastPart = true;//
					currentSize = dataLength;
					inputstreamPart = e.getLastInputStream();	
				}												
				
			} catch (IOException e) {
				client.abortMultipartUpload(abortMultipartUploadOptions);
				throw new Exception("[Upload failed.]");
			}
			
			partCount++;
			threadPool.execute(new UploadPartThread(bucketName,objectKey, uploadId, partCount, currentSize, inputstreamPart,client, partList));
			
			if(isLastPart)
				break;
		}
		
		
		// 等待全部线程执行结束
		threadPool.shutdown();
		while (!threadPool.isTerminated()) {
			threadPool.awaitTermination(5, TimeUnit.SECONDS);
        }
		
		// 上传失败
		if (partList.size() != partCount){
			client.abortMultipartUpload(abortMultipartUploadOptions);
			throw new Exception("[Upload failed.]");
			
		}
		// 上传成功
		else{		
			
			// 把partNum排序
	        Collections.sort(partList, new Comparator<UploadPart>(){
	            public int compare(UploadPart arg0, UploadPart arg1) {
	            	UploadPart part1= arg0;
	            	UploadPart part2= arg1;

	                return part1.getPartNumber() - part2.getPartNumber();
	            }  
	        });
			
			CompleteMultipartUploadOptions completeMultipartUploadOptions = new CompleteMultipartUploadOptions(bucketName, objectKey, uploadId, partList);
			client.completeMultipartUpload(completeMultipartUploadOptions);
			System.out.println("[Upload Suceess.]");		
		}		
	}