func NewReader(ctx context.Context, rd io.Reader, opts ...ReaderOption) io.Reader {
	rdOpts := &readerOpts{}
	for _, fn := range opts {
		fn(rdOpts)
	}
	sc := NewScanner(rd, rdOpts.scanOpts...)
	dc := NewDecompressor(ctx, rdOpts.decOpts...)
	errCh := make(chan error, 1)
	wg := new(sync.WaitGroup)
	wg.Add(1)
	go func() {
		errCh <- decompress(ctx, sc, dc)
		close(errCh)
		wg.Done()
	}()
	return &reader{
		ctx:   ctx,
		errCh: errCh,
		dc:    dc,
		wg:    wg,
	}
}
NewReader returns an io.Reader that uses a scanner and decompressor to decompress
bzip2 data concurrently.
package pbzip2
import (
	"context"
	"io"
	"sync"
)
type readerOpts struct {
	decOpts  []DecompressorOption
	scanOpts []ScannerOption
}
type ReaderOption func(o *readerOpts)
func ScannerOptions(opts ...ScannerOption) ReaderOption {
	return func(o *readerOpts) {
		o.scanOpts = append(o.scanOpts, opts...)
	}
}
func DecompressionOptions(opts ...DecompressorOption) ReaderOption {
	return func(o *readerOpts) {
		o.decOpts = append(o.decOpts, opts...)
	}
}
type reader struct {
	ctx   context.Context
	errCh chan error
	wg    *sync.WaitGroup
	dc    *Decompressor
}