code: public static VariantContextWriter createVariantContextWriter(OutputStream outputStream,
                                                                    SAMSequenceDictionary sequenceDictionary,
                                                                    Options ...options) {
          // setup writer
          VariantContextWriterBuilder builder = new VariantContextWriterBuilder()
                  .setOutputStream(outputStream)
                  .setReferenceDictionary(sequenceDictionary)
                  .setOption(Options.WRITE_FULL_FORMAT_FIELD)
                  .unsetOption(Options.INDEX_ON_THE_FLY);
  
          // options
          if (options != null) {
              for (Options option : options) {
                  builder.setOption(option);
              }
          }
  
          return builder.build();
      }
docs: Create a VariantContextWriter.
  
  @param outputStream              Output stream to write.
  @param sequenceDictionary        SAM sequence directory (it can be got from VCFHeader)
  @param options                   Writer options
  @return                          The variant context writer