protected byte [ ] loadClassDataFromFile ( String fileName ) { byte [ ] classBytes = null ; try { InputStream in = getResourceAsStream ( fileName ) ; if ( in == null ) { return null ; } ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; byte buf [ ] = new byte [ 1024 ] ; for ( int i = 0 ; ( i = in . read ( buf ) ) != - 1 ; ) baos . write ( buf , 0 , i ) ; in . close ( ) ; baos . close ( ) ; classBytes = baos . toByteArray ( ) ; } catch ( Exception ex ) { return null ; } return classBytes ; }
Load JSP class data from file .