1 package org.apache.bcel.classfile; 2 3 import java.io.*; 4 5 10 public class ProseSupport { 11 12 13 19 public static ConstantPool getConstantPool(byte[] code) { 20 try { 21 return new ConstantPool(new DataInputStream(new ByteArrayInputStream(code))); 22 } catch (IOException e) { 23 throw new RuntimeException ("Invalid bytecode", e); 24 } 25 } 26 27 34 public static Method getMethod(byte[] code, ConstantPool cp) { 35 try { 36 return new Method(new DataInputStream(new ByteArrayInputStream(code)), cp); 37 } catch (IOException e) { 38 throw new RuntimeException ("Invalid bytecode", e); 39 } 40 } 41 42 } 43 | Popular Tags |