func makeBGZFWriter(output io.WriteCloser, compressionLevel int) (io.WriteCloser, error) { bgzfWriter, err := bgzf.NewWriterLevel(output, compressionLevel, runtime.GOMAXPROCS(-1)) if err != nil { return nil, ErrInvalidCompressionLevel } return bgzfWriter, nil }
func (c *Compressor) BenchmarkBGZFWriter(b *testing.B) { cw, _ := bgzf.NewWriterLevel(c.w, flate.BestSpeed, runtime.NumCPU()) b.ResetTimer() _, err := io.Copy(cw, c.r) if err != nil { b.Fatal(err) } c.w.Sync() }
func makeWriter(w io.Writer, level, wc int) (*bgzf.Writer, error) { if bw, ok := w.(*bgzf.Writer); ok { return bw, nil } return bgzf.NewWriterLevel(w, level, wc) }