Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rileyJones/1c18338821b88e92a477bfa270344db3 to your computer and use it in GitHub Desktop.
Save rileyJones/1c18338821b88e92a477bfa270344db3 to your computer and use it in GitHub Desktop.
import java.io.BufferedInputStream;import java.io.FileInputStream;import java.io.IOException;import java.util.ArrayList;import java.util.Enumeration;import java.util.jar.JarEntry;import java.util.jar.JarFile;import java.io.FileNotFoundException;import java.util.jar.JarInputStream;import java.util.zip.ZipEntry;import java.util.zip.ZipInputStream;public class a{ public static void main(String[] args) throws IOException, FileNotFoundException { System.out.println('a'); JarFile t = new JarFile("C:\\Users\\galbraithja\\Desktop\\.git\\Test\\src\\test.jar"); ArrayList<JarEntry> classes = new ArrayList<JarEntry>(); JarEntry e = new JarEntry("C:\\Users\\galbraithja\\Desktop\\.git\\Test\\src\\test.jar"); System.out.println(t.toString() +" , " + e.toString()); System.out.println('c'); Enumeration<JarEntry> c = t.entries(); c.nextElement(); c.nextElement(); int f=0; while (c.hasMoreElements()) { classes.add(c.nextElement()); System.out.println(classes.get(f)); f++; //System.out.println(c.nextElement().toString()); } FileInputStream fis=new FileInputStream("C:\\Users\\galbraithja\\Desktop\\.git\\Test\\src\\test.jar"); BufferedInputStream bis=new BufferedInputStream(fis); JarInputStream zis=new JarInputStream(bis); JarEntry ze=null; ArrayList<byte[]> bytes = new ArrayList<byte[]>(); while((ze=zis.getNextJarEntry())!=null){ bytes.add(new byte[(int)ze.getSize()]); } }}
a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment