I'm using Apache BCEL to dynamically create java classes that will each have its own associated image. These generated class implement the following interface:
interface ImageOwner {
byte[] getImage();
}
When dynamically implementing the 'getImage' method, I could generate bytecodes to create/return the byte array when the method is invoked, but I would rather just return a reference to the byte array if possible. Is it possible to store raw data inside a java class file?