code: private byte[] getCSVOutput(List<String[]> lines)
      {
          StringWriter writer = new StringWriter();
          csv = new CSVWriter(writer, delimiter.separator().charAt(0));
          for(int i = 0; i < lines.size(); i++)
          {
              csv.writeNext((String[])lines.get(i), quotes);
          }
  
          // The contents returned is the CSV string
          return writer.toString().getBytes();
      }
docs: Returns the CSV output file data.
  @param lines The lines to add to the output file
  @return The byte array representing the CSV output file data