Package htsjdk.variant.variantcontext.writer

# Interface VariantContextWriter

All Superinterfaces:
  `AutoCloseable`, `Closeable`

All Known Implementing Classes:
  `AsyncVariantContextWriter`, `SortingVariantContextWriter`

public interface VariantContextWriter extends Closeable
this class writes VCF files

## Method Summary

Modifier and Type
Method
Description
`void`
`add(VariantContext vc)`
`boolean`
`checkError()`
`void`
`close()`
attempt to close the VCF file
`void`
`setHeader(VCFHeader header)`
Sets the VCF header so that data blocks can be written without writing the header Exactly one of writeHeader() or setHeader() should be called when using a writer
`void`
`writeHeader(VCFHeader header)`
Writes the header

## Method Details

### writeHeader

void writeHeader(VCFHeader header)
Writes the header

Parameters:
  `header` - header
Throws:
  `IllegalStateException` - if header is already written

### close

void close()
attempt to close the VCF file

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Closeable`

### checkError

boolean checkError()

Returns:
  true if the underlying stream is a java.io.PrintStream and its checkError returned true, used for pipelines

### add

void add(VariantContext vc)

### setHeader

void setHeader(VCFHeader header)
Sets the VCF header so that data blocks can be written without writing the header Exactly one of writeHeader() or setHeader() should be called when using a writer

Parameters:
  `header` - VCF header
Throws:
  `IllegalStateException` - if header or body is already written