java - When i write file I got space in the end How I can change it? -


i tried read content , write file. code run on server when server on linux don't have problem. when run on windows string in end got space how can fix ?

  public static void readfile(inputstream inputstream, outputstream outputstream, boolean closein, boolean closeout) throws ioexception {     byte[] buffer = new byte[4096];     int read = 0;     try {         while ((read = inputstream.read(buffer)) != -1)             outputstream.write(buffer, 0, read);     } {         //close input , output     } } 


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -