title: Android and IOUtils.toByteArray
body: <p>I write app on android which will send xml file to PHP server. Here is my code:</p>
  
  <pre><code>InputStream is = new FileInputStream(file);
  HttpClient httpClient = new DefaultHttpClient();
  HttpPost postReq = new HttpPost("http://majkelsoftgames.cba.pl/ser/server.php");
  
  byte[] data = IOUtils.toByteArray(is);
  InputStreamBody isb= new InputStreamBody(new ByteArrayInputStream(data), "file");
  
  MultipartEntity multipartContent = new MultipartEntity();
  multipartContent.addPart("file", isb);
  
  postReq.setEntity(multipartContent);
  HttpResponse response = httpClient.execute(postReq);
  </code></pre>
  
  <p>My problem is that when </p>
  
  <pre><code>byte[] data = IOUtils.toByteArray(is);
  </code></pre>
  
  <p>is executing I get:</p>
  
  <pre><code>java.lang.NoClassDefFoundError: org.apache.commons.io.IOUtils
  </code></pre>
  
  <p>I downloaded external commons-io.jar from <a href="http://commons.apache.org/io/" rel="nofollow">http://commons.apache.org/io/</a> and added this jar to the java build path in android project. I really have no idea what I am doing wrong. Do you have any idea how can I fix it?</p>