use of com.ibm.dtfj.javacore.builder.javacore.ImageBuilderFactory in project openj9 by eclipse.
the class JCImageFactory method getImage.
/**
*/
public Image getImage(File arg0) throws IOException {
InputStream stream = new FileInputStream(arg0);
try {
Image image = new JavaCoreReader(new ImageBuilderFactory()).generateImage(stream);
// following cast is safe since examining the code path from generateImage
// shows that what comes back can only be the JCImage from
// com.ibm.dtfj.javacore.builder.javacore.ImageBuilder, instance variable _fImage
((JCImage) image).setSource(arg0.toURI());
return image;
} finally {
stream.close();
}
}
use of com.ibm.dtfj.javacore.builder.javacore.ImageBuilderFactory in project openj9 by eclipse.
the class JCImageFactory method getImage.
public Image getImage(final ImageInputStream in, URI sourceID) throws IOException {
InputStream stream = new InputStream() {
public int read() throws IOException {
return in.read();
}
};
try {
Image image = new JavaCoreReader(new ImageBuilderFactory()).generateImage(stream);
((JCImage) image).setSource(sourceID);
return image;
} finally {
in.close();
}
}
Aggregations