I cannot download the file in following url: http://ift.tt/1Hf92xf
Only a part of the file is being downloaded.
Following is my code. Please let me know if I'm doing anything wrong.
URLConnection urlConn = new URL( "http://ift.tt/1Hf92xf").openConnection();
InputStream is = urlConn.getInputStream();
FileOutputStream fos = new FileOutputStream( file.getPath() );
byte[] buffer = new byte[4096];
int len;
while( ( len = is.read( buffer ) ) > 0 )
{
fos.write( buffer, 0, len );
}
Aucun commentaire:
Enregistrer un commentaire