public byte [ ] getJarBytes ( ) throws EeClassLoaderException { DataInputStream dataInputStream = null ; byte [ ] bytes ; try { long jarEntrySize = jarEntry . getSize ( ) ; if ( jarEntrySize <= 0 || jarEntrySize >= Integer . MAX_VALUE ) { throw new EeClassLoaderException ( "Invalid size " + jarEntrySize + " for entry " + jarEntry ) ; } bytes = new byte [ ( int ) jarEntrySize ] ; InputStream inputStream = jarFileInfo . getJarFile ( ) . getInputStream ( jarEntry ) ; dataInputStream = new DataInputStream ( inputStream ) ; dataInputStream . readFully ( bytes ) ; } catch ( IOException e ) { throw new EeClassLoaderException ( null , e ) ; } finally { if ( dataInputStream != null ) { try { dataInputStream . close ( ) ; } catch ( IOException e ) { // Ignore } } } return bytes ; }
Read JAR entry and return byte array of this JAR entry .