All Downloads are FREE. Search and download functionalities are using the official Maven repository.

htsjdk.samtools.fastq.AsyncFastqWriter Maven / Gradle / Ivy

There is a newer version: 4.1.3
Show newest version
package htsjdk.samtools.fastq;

import htsjdk.samtools.util.AbstractAsyncWriter;

/**
 * Implementation of a FastqWriter that provides asynchronous output.
 * @author Tim Fennell
 */
public class AsyncFastqWriter extends AbstractAsyncWriter implements FastqWriter {
    private final FastqWriter writer;

    public AsyncFastqWriter(final FastqWriter out, final int queueSize) {
        super(queueSize);
        this.writer = out;
    }

    @Override protected String getThreadNamePrefix() { return "FastqWriterThread-"; }
    @Override protected void synchronouslyWrite(final FastqRecord item) { this.writer.write(item); }
    @Override protected void synchronouslyClose() { this.writer.close(); }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy