title: ZipEntry to byte array
body: <p>I was trying to serialize a ZipEntry object into a byte array and I've understood that it's not possible.</p>
  
  <p>Here's what I'm doing:</p>
  
  <pre><code>ZipEntry entryToDocumentum = null;
  for (ZipEntry oneEntry : entries) { //entries is a ZipEntry arraylist
     if (oneEntry.getName().equals(details.getId()+"_"+details.getCodEntidade()+"_"+details.getNrDocumento()+".pdf")) {
           entryToDocumentum = oneEntry;
  
     }
  }
  byte[] entryBytes =  serializeEntry(entryToDocumentum);
  </code></pre>
  
  <p>serializeEntry method:</p>
  
  <pre><code>private static byte[] serializeEntry(Object obj) throws IOException {
      ByteArrayOutputStream b = new ByteArrayOutputStream();
      ObjectOutputStream o = new ObjectOutputStream(b);
      o.writeObject(obj); //here is where I get the NotSerializable exception
      return b.toByteArray();
  }
  </code></pre>
  
  <p>If a ZipEntry is not serializable, how can I convert a ZipEntry to a byte array?</p>