code: public void setInputStream(InputStream inputStream, long inputStreamLength) {
  		// close last file when set a new inputStream
  		if (this.isUploadFile){
  			try{
  				this.inputStream.close();
  			}
  			catch (Exception e){
  			}
  		}
  
  		if (inputStream instanceof FDSProgressInputStream){
  			this.inputStream = (FDSProgressInputStream) inputStream;
  		}
  		else {
  			this.inputStream = new FDSProgressInputStream(inputStream, this.progressListener);
  		}
  		if (this.progressListener != null){
  			this.progressListener.setTransferred(0);
  			this.progressListener.setTotal(inputStreamLength);
  		}
  		this.isUploadFile = false;
  		this.inputStreamLength = inputStreamLength;
  	}
docs: Auto convert inputStream to FDSProgressInputStream in order to invoke progress listener
  @param inputStream
  @param inputStreamLength the length of inputStream, set -1 if the length is uncertain