Package htsjdk.samtools.util
Class IntervalListWriter
- java.lang.Object
-
- htsjdk.samtools.util.IntervalListWriter
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class IntervalListWriter extends Object implements Closeable
Writes out the list of intervals to the supplied file. This class is particularly useful if we have many intervals to write, such that they all cannot be held in memory, for example in anIntervalList.
-
-
Constructor Summary
Constructors Constructor Description IntervalListWriter(Path path)Creates a new writer, writing a header to the file.IntervalListWriter(Path path, SAMFileHeader header)Creates a new writer, writing a header to the file.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the writer.voidwrite(Interval interval)Writes a single interval list.
-
-
-
Constructor Detail
-
IntervalListWriter
public IntervalListWriter(Path path)
Creates a new writer, writing a header to the file.- Parameters:
path- a path to write to. If exists it will be overwritten.
-
IntervalListWriter
public IntervalListWriter(Path path, SAMFileHeader header)
Creates a new writer, writing a header to the file.- Parameters:
path- a file to write to. If exists it will be overwritten.header- the header to write.
-
-
Method Detail
-
write
public void write(Interval interval) throws IOException
Writes a single interval list.- Parameters:
interval- the interval to write.- Throws:
IOException
-
close
public void close() throws IOExceptionCloses the writer.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-