download - Java NIO downloaded file is different than web browser -


i trying download .torrent file url using java nio. downloading file web browser results in proper torrent file can used. downloading in java results in different/corrupted file.

this code using perform download:

url url = new url("http://torcache.net/torrent/e4b5326aa31d1ae0c30e05129193e87aa086f5f8.torrent"); readablebytechannel rbc = channels.newchannel(url.openstream()); fileoutputstream fos = new fileoutputstream("test.torrent"); fos.getchannel().transferfrom(rbc, 0, long.max_value); fos.close(); 


Comments

Popular posts from this blog

java - Solr query version issue: Invalid version or the data in not in 'javabin' format -

Hard vs. Soft Water: What's The Difference?

The Ten Most Livable Cities In The World