title: How can I convert byte array to ZIP file
body: <p>I am trying to convert an array of bytes into a ZIP file. I got bytes using the following code: </p>
  
  <pre><code>byte[] originalContentBytes= new Verification().readBytesFromAFile(new File("E://file.zip"));
  
  private byte[] readBytesFromAFile(File file) {
      int start = 0;
      int length = 1024;
      int offset = -1;
      byte[] buffer = new byte[length];
      try {
          //convert the file content into a byte array
          FileInputStream fileInuptStream = new FileInputStream(file);
          BufferedInputStream bufferedInputStream = new BufferedInputStream(
                  fileInuptStream);
          ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
  
          while ((offset = bufferedInputStream.read(buffer, start, length)) != -1) {
              byteArrayOutputStream.write(buffer, start, offset);
          }
  
          bufferedInputStream.close();
          byteArrayOutputStream.flush();
          buffer = byteArrayOutputStream.toByteArray();
          byteArrayOutputStream.close();
      } catch (FileNotFoundException fileNotFoundException) {
          fileNotFoundException.printStackTrace();
      } catch (IOException ioException) {
          ioException.printStackTrace();
      }
  
      return buffer;
  }
  </code></pre>
  
  <p>But my problem now is with converting the byte array back into a ZIP file - how can it be done?</p>
  
  <p><strong>Note : The specified ZIP contains two files.</strong> </p>