BGZFStream(io::IO[, mode::AbstractString="r"])
BGZFStream(filename::AbstractString[, mode::AbstractString="r"])

Create an I/O stream for the BGZF compression format.

The first argument is either an IO object or a filename. If mode is "r" (read) the BGZF stream will be in read mode and decompress the underlying BGZF blocks while reading. In read mode, BGZFStream supports the seek operation using a virtual file offset (see VirtualOffset). If mode is "w" (write) or "a" (append) the BGZF stream will be in write mode and compress written data to BGZF blocks.

VirtualOffset(block_offset::Integer, inblock_offset::Integer)

Create a virtual file offset from block_offset and inblock_offset.

block_offset is an offset pointing to the beggining 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.