1 6 package de.uka.ipd.coverage.utils; 7 8 import java.io.*; 9 10 import org.apache.bcel.classfile.Code; 11 12 13 24 29 class ByteCodePrinterThread extends Thread { 30 31 private PrintStream out; 32 private String id; 33 private Code code; 34 private BufferedReader reader; 35 36 37 38 public ByteCodePrinterThread(Code code) { 39 super(); 40 this.code = code; 41 PipedInputStream in = new PipedInputStream(); 42 reader = new BufferedReader(new InputStreamReader(in)); 43 try { 44 out = new PrintStream(new PipedOutputStream(in)); 45 } catch (IOException e) { 46 e.printStackTrace(); 47 } 48 } 49 50 51 public void run() { 52 ByteCodePrinter.printByteCode(out, null, code, false, false); 53 out.flush(); 54 out.close(); 55 } 56 57 public BufferedReader getReader() { 58 return reader; 59 } 60 } 61 | Popular Tags |