save torrent file error
Metafile metafile = new Metafile(new BufferedInputStream(new FileInputStream(filename))); // filename1 is a new torrent file metafile.print(new BufferedOutputStream(new FileOutputStream(filename1, true))); //but filename1 can't be used
//first,edit Announce/Comment/FileName or something else in a torrent file,after that save a new torrent file,how to do that?
Hi @edeye, what do you mean with the following?
//but filename1 can't be used
Could you share a snippet of code demonstrating what you're trying to do and the output you get?
very sorry that my english is not good... I want to edit the Comment in the torrent,@abahgat
String filename = "C:\\Users\\k\\Desktop\\oldBtFile.torrent";
Metafile metafile = new Metafile(new BufferedInputStream(
new FileInputStream(filename)));
String a = metafile.getComment();
metafile.setComment(a + "my flag");
String filename1 = "C:\\Users\\k\\Desktop\\newBtFile.torrent";
metafile.print(new BufferedOutputStream(new FileOutputStream(filename1,
true)));
// when I use torrent Client open newBtFile.torrent, alert "Failure to obtain seed information"
// how can I edit the Announce/Comment/Files in a torrent,then save a new one
Thanks, I understand what you mean, I am adding tests to the library, so that we can reproduce that scenario.
Hi @edeye, the test in 123684d is doing what you're trying to do here, but it seems like it's passing, can you take a look?
There's one thing that might explain what you're seeing, though: can you tell me what's the default encoding on the platform you're using?
Thanks
@abahgat I'am sorry that bother you again, = =! I want to edit a torrent file(such as some Sensitive words info,I need to change it), and save it to a new torrent file, then I can use the new torrent file which the Sensitive words has been changed
It's hard to say what's going wrong without being able to see your code. Perhaps you could try uploading your code to a gist so that we can take a look?
Cheers!