title: Java - getManifest() issue: Not first entry
body: <p>I want to generate programtically a jar file in java. This works well when the input jar file has NOT been obfuscated. When I use an obfuscator on it, the first entry is no longer the manifest, so I can't generate a new file...</p>
  
  <p>Here is my code:</p>
  
  <pre><code>JarInputStream input = new JarInputStream(getClass().getResourceAsStream("/obfuscated_jar.jar"));
  JarOutputStream output = new JarOutputStream(new FileOutputStream("generated_jar.jar"), input.getManifest());
  </code></pre>
  
  <p>The line <code>input.getManifest()</code> returns null because the manifest is not at the first place.</p>
  
  <p>I've made some searches on it, and it looks to be a known issue with <code>JarInputStream</code>. So here is my question: Is it possible to solve it? Like writing my own getManifest method or something?</p>