InputStream in = clazz.getResourceAsStream(prologResource);
if (in == null) {
throw new FileNotFoundException(prologResource);
}
try {
SymbolTerm pathTerm = SymbolTerm.create(prologResource);
JavaObjectTerm inTerm =
new JavaObjectTerm(new PushbackReader(new BufferedReader(
new InputStreamReader(in, "UTF-8")), Prolog.PUSHBACK_SIZE));
if (!env.execute(Prolog.BUILTIN, "consult_stream", pathTerm, inTerm)) {
throw new CompileException("Cannot consult " + prologResource);