code: public void write(FileColumn[] columns, List<String[]> lines) throws IOException
      {
          Object contents = getContents(columns, lines);
          if(stream != null && contents instanceof byte[])
          {
              byte[] bytes = (byte[])contents;
              stream.write(bytes);
          }
      }
  
      /**
       * Close the output file objects.
       */
      public void close()
      {
          try
          {
              // Close the workbook
              if(workbook != null)
                  workbook.close();
          }
          catch(Exception e)
          {
          }
  
          try
          {
              // Flush and close the byte stream
              if(baos != null)
              {
                  baos.flush();
                  baos.close();
              }
          }
docs: Write the contents of the output file to the output stream.
  @param columns The column definitions for the output file
  @param lines The lines to add to the output file
  @throws IOException if there was an error writing to the stream