bgzf

package
v5.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2022 License: AGPL-3.0, AGPL-3.0-or-later Imports: 11 Imported by: 0

Documentation

Overview

packge bgzf provides readers and writers for BGZF files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsGzip

func IsGzip(scanner io.ByteScanner) (bool, error)

IsGzip determines if the the given byte scanner produces a gzip file. It uses ReadByte and UnreadByte to check only the initial byte from the input.

Types

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

Reader reads in parallel from a BGZF file.

func NewReader

func NewReader(r flate.Reader) (*Reader, error)

NewReader returns a Reader for the given flate.Reader

func (*Reader) Close

func (bgzf *Reader) Close() error

Close implements the corresponding method of io.Closer

func (*Reader) Read

func (bgzf *Reader) Read(p []byte) (n int, err error)

Read implements the corresponding method of io.Reader

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

Writer writes in parallel to a BGZF file.

func NewWriter

func NewWriter(w io.Writer, level int) *Writer

NewWriter returns a Writer for the given io.Writer.

Following zlib, levels range from 1 (BestSpeed) to 9 (BestCompression); higher levels typically run slower but compress more. Level 0 (NoCompression) does not attempt any compression; it only adds the necessary DEFLATE framing. Level -1 (DefaultCompression) uses the default compression level. Level -2 (HuffmanOnly) will use Huffman compression only, giving a very fast compression for all types of input, but sacrificing considerable compression efficiency.

func (*Writer) Close

func (bgzf *Writer) Close() error

Close implements the corresponding method of io.Closer

func (*Writer) Write

func (bgzf *Writer) Write(p []byte) (n int, err error)

Write implements the corresponding method of io.Writer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL