protected byte [ ] getClassDefinition ( final String name0 ) { if ( typeNotFound ( name0 ) ) return null ; byte [ ] ba = null ; String name = name0 . replace ( "." , "/" ) + ".class" ; InputStream is = getResourceAsStream ( name ) ; if ( null != is ) { try { ByteArrayOutputStream os = new ByteArrayOutputStream ( ) ; byte [ ] buffer = new byte [ 8192 ] ; int count ; while ( ( count = is . read ( buffer , 0 , buffer . length ) ) > 0 ) { os . write ( buffer , 0 , count ) ; } ba = os . toByteArray ( ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } finally { try { is . close ( ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } } if ( null == ba ) { IByteCodeHelper helper = engine . conf ( ) . byteCodeHelper ( ) ; if ( null != helper ) { ba = helper . findByteCode ( name0 ) ; } } if ( null == ba ) { setTypeNotFound ( name0 ) ; } return ba ; }
Search for the byte code of the given class .