CodecBGZF.BGZFCodecType
BGZFCodec{T, IO} <: Codec

Codec used to compress or decompress data from the input IO source of type IO. T must be LibDeflate.Compressor or LibDeflate.Decompressor.

CodecBGZF.BGZFCompressorStreamMethod
BGZFCompressorStream(io::IO; threads=nthreads(), compresslevel=6)

Create a TranscodingStream which block-gzip compresses data from the underlying io with the given compresslevel. The stream will compress up to threads block concurrently.

CodecBGZF.BGZFDecompressorStreamMethod
BGZFDecompressorStream(io::IO; threads=nthreads())

Create a TranscodingStream which decompresses block-gzipped data from the underlying io. The stream will compress up to threads block concurrently.

CodecBGZF.BGZFErrorType
BGZFError(message::String)

BGZF de/compressor errored with message when processing data."

CodecBGZF.VirtualOffsetMethod
VirtualOffset(block_offset::Integer, inblock_offset::Integer)

Create a virtual file offset from block_offset and inblock_offset. Get the two offsets with offsets(v).

block_offset is an offset pointing to the beginning position of a BGZF block in a BGZF file and inblock_offset is an offset pointing to the begining position of a binary data within a uncompressed BGZF block. These values are zero-based and their valid ranges are [0, 1 << 48) and [0, 1 << 16), respectively.

CodecBGZF.VirtualOffsetMethod
VirtualOffset(stream::BGZFDecompressorStream)

Obtain the VirtualOffset of the curret position of stream. If stream's input stream is seekable, seeking to this offset will leave the stream in an equivalent state to its current state. A BGZFDecompressorStream only tracks the offset of the 16 previous blocks. If more than 16 blocks are stored in stream's output buffer, this operation will fail.

Base.seekMethod
seek(stream::BGZFDecompressorStream, v::VirtualOffset)

Seek stream to the given VirtualOffsetv. v must be a valid virtual offset for the given stream, i.e. its coffset must be the offset of a valid BGZF block, and its uoffset must be an integer in [0, block_len]. Furthermore, stream's underlying stream must be seekable.

Base.seekstartMethod
seekstart(stream::BGZFDecompressorStream)

Seek the stream's input stream to its beginning, and resets the stream.

CodecBGZF.gziMethod
gzi(io::IO)

Construct a Vector{UInt8} with the GZI of a BGZF file of an IO representing a BGZF file. GZI files contain offsets for each block and its decompressed payload in a BGZF file. A GZI file is approximately 1/4000th the size of the decompressed data in a BGZF file.

Examples

julia open(gzi, "/my/bgzip/file.bgz")
102744-element Array{UInt8,1}:
 0x15
 0x19
 0x00
 0x00
 0x00
[ ... ]
CodecBGZF.increment_block!Method

Switches the code to the next block to process, given whether the input stream is eof. Returns block index, or nothing if there are no more blocks to process

CodecBGZF.index!Method

Get relevant positions of the compressed block in data

CodecBGZF.load_block!Function

Prepare the block to be de/compressed. Unlike the queue operation, the loading function may mutate the codec, and is therefore not threadsafe.

CodecBGZF.remainingMethod

Get number of remaning bytes in the codec's buffer before a new block can be indexed