public byte [ ] getBytes ( ) { ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; try { workbook . write ( baos ) ; } catch ( IOException e ) { new RuntimeException ( e ) ; } finally { if ( baos != null ) try { baos . close ( ) ; } catch ( IOException e ) { new RuntimeException ( e ) ; } } return baos . toByteArray ( ) ; }
Gets the excel file as byte array .