private byte [ ] getExcelOutput ( FileColumn [ ] columns , List < String [ ] > lines ) throws IOException { // Create the workbook baos = new ByteArrayOutputStream ( 1024 ) ; if ( existing != null ) workbook = Workbook . createWorkbook ( format , baos , existing ) ; else workbook = Workbook . createWorkbook ( format , baos ) ; workbook . setHeaders ( hasHeaders ( ) ) ; if ( append && workbook . getSheet ( worksheet ) != null ) workbook . appendToSheet ( columns , lines , worksheet ) ; else workbook . createSheet ( columns , lines , worksheet ) ; // Write out the workbook to the stream workbook . write ( ) ; workbook . close ( ) ; // The contents returned is the byte array return baos . toByteArray ( ) ; }
Returns the XLS or XLSX output file data .