Downloading mp3 files from Tomcat server to android client
<p>I am able to download pdf,image files but for mp3 files it gives me <code>Java IO Exception:Malformed IPv6 address ....</code></p>

<p>I am using <code>Url</code> method to download files from Tomcat server to android client and i am giving <code>192.168.1.4:8080</code> as my <code>url address</code>.</p>

<p>my code is as follows:</p>

<pre><code>      filename=new File(imagepath).getName();
      FileOutputStream fil=new FileOutputStream(pathfolder+"/"+filename);

     URL url=new URL("http://192.168.1.4:8080/RestWebServiceDemo/upload/"+filename);

      HttpURLConnection urlconnection=null;
      urlconnection=(HttpURLConnection)url.openConnection();

      urlconnection.setRequestMethod("GET");
      urlconnection.setDoOutput(true);
      urlconnection.connect();


      int total_size=urlconnection.getContentLength();
      Log.i("totall sizeeeeeee",""+total_size);
      InputStream inpstream = urlconnection.getInputStream();
      byte[] buffer=new byte[total_size];
      int buffleng=0,download_size=0;
      while((buffleng=inpstream.read(buffer))&gt;0)
      {

      fil.write(buffer,0,buffleng);

      }

      }
      catch(Exception ex){

          ex.printStackTrace();

      }
</code></pre>
