title: how to remove bytes from zip file in java?
body: <p>I made a project to encrypt a file by converting it to a zip file, then adding an array of bytes to it.<br>
  When clicking on the file after addition, it returns "damaged file". </p>
  
  <pre><code>import java.io.BufferedWriter;
  import java.io.File;
  import java.io.FileInputStream;
  import java.io.FileOutputStream;
  import java.io.FileWriter;
  
  public class TestByteSyt {  
  byte[] data;
  public void choos(String path){
  try{
  data=getBytesContent(path);}catch(Exception e){
     System.out.print("there is problem");
    }   
  }
    public  byte[] getBytesContent(String path){
      byte[] filedata = null;
      try{
        File file = new File(path);
        filedata = new byte[(int)file.length()];
        FileInputStream input = new FileInputStream(file);
        FileOutputStream output= new FileOutputStream(file);
        //input.read(filedata);
        String pass="the password is sobhi saede";
        byte[] b=pass.getBytes();
         System.out.print(b);
         output.write(b);
         input.close();
         output.close();
          // System.out.print( file.delete());
          BufferedWriter out = new BufferedWriter(new FileWriter(file));
          out.close();
          } catch (Exception e) 
      {System.out.print("no file ");}
      return filedata;
    }}    
  </code></pre>
  
  <p>How to remove the added bytes from the zip file to make it work again? </p>