how setEntity method works in java : I am develop a java program which will send my file in whole junk of file to my server for scanning via certain url http://ServerUrl:portNumber/file but i am getting this error in my eclipse compiler <br>The method setEntity(HttpEntity) in the type HttpEntityEnclosingRequestBase is not applicable for the arguments (InputStream). Is it because Java Inputstream cant use together with setEntity method? I cant read the file byte by byte because the file will not only have document file,it's might have .exe file as well. <br> Here is my source code <br>

	import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.*;
    import org.apache.http.HttpResponse;
	import org.apache.http.client.HttpClient;
	import org.apache.http.client.methods.HttpPost;
	import org.apache.http.entity.StringEntity;
	import org.apache.http.impl.client.DefaultHttpClient;

	public class SentFile {
	
	public static void main(String [] args)
	{
		  HttpClient client = new DefaultHttpClient();
		  HttpPost post = new HttpPost("http://192.168.0.25:8008/file");
		  File file = new File("testScanFile.txt");
		  InputStream is = new FileInputStream(file);
		  post.setEntity(is);
		  HttpResponse response = client.execute(post);
		  BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
		  String line = "";
		  while ((line = rd.readLine()) != null) {
		   System.out.println(line);
		  }
		 }
		
	}


