1 28 29 package com.caucho.bytecode; 30 31 import com.caucho.log.Log; 32 import com.caucho.util.L10N; 33 34 import java.io.IOException ; 35 import java.io.InputStream ; 36 import java.util.logging.Logger ; 37 38 41 public class ByteCode { 42 static private final Logger log = Log.open(ByteCode.class); 43 static private final L10N L = new L10N(ByteCode.class); 44 45 48 public JavaClass readFromClassPath(String classFile) 49 throws IOException 50 { 51 Thread thread = Thread.currentThread(); 52 ClassLoader loader = thread.getContextClassLoader(); 53 54 InputStream is = loader.getResourceAsStream(classFile); 55 try { 56 return parse(is); 57 } finally { 58 is.close(); 59 } 60 } 61 62 65 public JavaClass parse(InputStream is) 66 throws IOException 67 { 68 return new ByteCodeParser().parse(is); 69 } 70 } 71 | Popular Tags |