title: Combine 2 byte arrays in 2 different Objects to a .Zip file in java
body: <p>I have 2 Objects which has byte arrays in each where each object represent .ABC file and .XYZ file formats respectively. Both these 2 objects/file formats needs to be part of a .Zip file which means <strong>.ABC(JobExportDto)+.XYZ(JobExportDto) = .Zip(JobExportDto)</strong> file</p>
  <p><strong>.ABC file Format</strong></p>
  <pre><code>    @Data
      public class JobExportDto implements Serializable, IValidable {
      
          private static final long serialVersionUID = -4230073680958541795L;
      
          private final byte[] exportFileBytes;
      
          @Override
          public boolean valid() {
              return this.exportFileBytes != null &amp;&amp; this.exportFileBytes.length &gt; 0;
          }
      }
  </code></pre>
  <p><strong>+</strong></p>
  <p><strong>.XYZ file Format</strong>**</p>
  <pre><code>@Data
  public class JobExportDto implements Serializable, IValidable {
  
      private static final long serialVersionUID = -4230073680958541795L;
  
      private final byte[] exportFileBytes;
  
      @Override
      public boolean valid() {
          return this.exportFileBytes != null &amp;&amp; this.exportFileBytes.length &gt; 0;
      }
  }
  </code></pre>
  <p><strong>=</strong></p>
  <p><strong>.Zip File Format</strong></p>
  <pre><code>@Data
  public class JobExportDto implements Serializable, IValidable {
  
      private static final long serialVersionUID = -4230073680958541795L;
  
      private final byte[] exportFileBytes;
  
      @Override
      public boolean valid() {
          return this.exportFileBytes != null &amp;&amp; this.exportFileBytes.length &gt; 0;
      }
  }
  </code></pre>
  <p>How to achieve the above?</p>