/** * Read class definition from a file. * * @param file The file to read. * * @return The class bytes * * @throws IOException Indicates a problem accessing the given stream. */ public static byte[] readByteCode(File file) throws IOException { return ByteCodeHelper.readByteCode( new FileInputStream( file ) ); }
final byte[] originalBytecode = ByteCodeHelper.readByteCode( is ); final byte[] transformedBytecode = classTransformer.transform( getParent(), name, null, null, originalBytecode ); if ( transformedBytecode == null ) {
public Class loadClass(String name) throws ClassNotFoundException { if ( name.equals( "org.hibernate.LockMode" ) ) { throw new ClassNotFoundException( "Could not find "+ name ); } if ( ! name.equals( "org.hibernate.test.util.SerializableThing" ) ) { return getParent().loadClass( name ); } Class c = findLoadedClass( name ); if ( c != null ) { return c; } InputStream is = this.getResourceAsStream( name.replace( '.', '/' ) + ".class" ); if ( is == null ) { throw new ClassNotFoundException( name + " not found" ); } try { byte[] bytecode = ByteCodeHelper.readByteCode( is ); return defineClass( name, bytecode, 0, bytecode.length ); } catch( Throwable t ) { throw new ClassNotFoundException( name + " not found", t ); } } }
/** * Read class definition from a file. * * @param file The file to read. * * @return The class bytes * * @throws IOException Indicates a problem accessing the given stream. */ public static byte[] readByteCode(File file) throws IOException { return ByteCodeHelper.readByteCode( new FileInputStream( file ) ); }
/** * Read class definition from a file. * * @param file The file to read. * * @return The class bytes * * @throws IOException Indicates a problem accessing the given stream. */ public static byte[] readByteCode(File file) throws IOException { return ByteCodeHelper.readByteCode( new FileInputStream( file ) ); }
/** * Read class definition from a file. * * @param file The file to read. * * @return The class bytes * * @throws IOException Indicates a problem accessing the given stream. */ public static byte[] readByteCode(File file) throws IOException { return ByteCodeHelper.readByteCode( new FileInputStream( file ) ); }
public void process(File file) throws Exception { ZipInputStream zip = new ZipInputStream( new FileInputStream( file ) ); try { ZipEntry entry; while ( (entry = zip.getNextEntry()) != null ) { byte bytes[] = ByteCodeHelper.readByteCode( zip ); entryHandler.handleEntry( entry, bytes ); zip.closeEntry(); } } finally { zip.close(); } } }
public void process(File file) throws Exception { ZipInputStream zip = new ZipInputStream( new FileInputStream( file ) ); try { ZipEntry entry; while ( (entry = zip.getNextEntry()) != null ) { byte bytes[] = ByteCodeHelper.readByteCode( zip ); entryHandler.handleEntry( entry, bytes ); zip.closeEntry(); } } finally { zip.close(); } } }
byte[] originalBytecode = ByteCodeHelper.readByteCode( is ); byte[] transformedBytecode = classTransformer.transform( getParent(), name, null, null, originalBytecode ); if ( originalBytecode == transformedBytecode ) {
byte[] originalBytecode = ByteCodeHelper.readByteCode( is ); byte[] transformedBytecode = classTransformer.transform( getParent(), name, null, null, originalBytecode ); if ( originalBytecode == transformedBytecode ) {
final byte[] originalBytecode = ByteCodeHelper.readByteCode( is ); final byte[] transformedBytecode = classTransformer.transform( getParent(), name, null, null, originalBytecode ); if ( transformedBytecode == null ) {
byte[] bytes = ByteCodeHelper.readByteCode( file ); ClassDescriptor descriptor = getClassDescriptor( bytes ); ClassTransformer transformer = getClassTransformer( descriptor, classNames );
byte[] bytes = ByteCodeHelper.readByteCode( file ); ClassDescriptor descriptor = getClassDescriptor( bytes ); ClassTransformer transformer = getClassTransformer( descriptor, classNames );
byte[] bytes = ByteCodeHelper.readByteCode( file ); ClassDescriptor descriptor = getClassDescriptor( bytes ); classNames.add( descriptor.getName() );
byte[] bytes = ByteCodeHelper.readByteCode( file ); ClassDescriptor descriptor = getClassDescriptor( bytes ); classNames.add( descriptor.getName() );