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

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -