Created
July 26, 2017 21:52
-
-
Save rileyJones/1c18338821b88e92a477bfa270344db3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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