code: 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();
      }
docs: Returns the XLS or XLSX output file data.
  @param columns The column definitions for the output file
  @param lines The lines to add to the output file
  @return The XLS or XLSX output file data