if (clazzBytes != null) {
log.debug("loading from store " + pClazzName);
final char[] fileName = pClazzName.toCharArray();
try {
final ClassFileReader classFileReader = new ClassFileReader(clazzBytes, fileName, true);
return new NameEnvironmentAnswer(classFileReader, null);
} catch (final ClassFormatException e) {
log.error("wrong class format", e);
return null;
}
}
log.debug("not in store " + pClazzName);
final InputStream is = pClassLoader.getResourceAsStream(resourceName);
if (is == null) {
log.debug("class " + pClazzName + " not found");
return null;
}
final byte[] buffer = new byte[8192];
final ByteArrayOutputStream baos = new ByteArrayOutputStream(buffer.length);
int count;
try {
while ((count = is.read(buffer, 0, buffer.length)) > 0) {
baos.write(buffer, 0, count);
}
baos.flush();
final char[] fileName = pClazzName.toCharArray();
final ClassFileReader classFileReader = new ClassFileReader(baos.toByteArray(), fileName, true);
return new NameEnvironmentAnswer(classFileReader, null);
} catch (final IOException e) {
log.error("could not read class", e);
return null;
} catch (final ClassFormatException e) {