fileoutputstream - Convert filleoutputstream to a file java -


good day

i downloading file using ftpclient, , downloading successfully, have problem converting file

for example downloading file called "helper.pdf" , want download file local file called "helper.pdf"

here code

ftpclient client = new ftpclient();   fileoutputstream fos = null;   try   {      client.connect(host);      client.login(user_ftp, password_ftp);      if (client.changeworkingdirectory("workingdirectory"))      {                     fos = new fileoutputstream(copy_file);         if (client.retrievefile(copy_file, fos))         {            //system.out.println("fos : "+fos.tostring());            //objectinputstream restore_file = new objectinputstream(fos);         }                     fos.close();      }      joptionpane.showmessagedialog(null, "downloaded", "info", joptionpane.information_message);   }   catch (exception err)   {      joptionpane.showmessagedialog(null, "error downloading update file", "error", joptionpane.error_message);   } 

so question how convert fileoutputstream pdf or save pdf file.

file file = new file("c:/help.pdf"); fos = new fileoutputstream(file); if (client.retrievefile("help.pdf", fos)) 

Comments