Sha256: 8c5c1137c022a1a14d5675ae0d3134a90474d86f40acfceba882db12510f9a6b
Contents?: true
Size: 741 Bytes
Versions: 3
Compression:
Stored size: 741 Bytes
Contents
require 'zlib' module Bio::BGZF # Packs +str+ into a BGZF block using # given compression +level+. def pack(str, level=Zlib::BEST_COMPRESSION) zs = Zlib::Deflate.new level, -15 cdata = zs.deflate str, Zlib::FINISH zs.close crc32 = Zlib.crc32 str, 0 isize = str.length bsize = cdata.length + 19 + XLEN array = [ ID1, ID2, CM, FLG, MTIME, XFL, OS, XLEN, SI1, SI2, SLEN, bsize, cdata, crc32, isize ] array.pack('CCCCVCCvCCvva*VV') end module_function :pack end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
bio-bgzf-0.2.1 | lib/bio-bgzf/pack.rb |
bio-bgzf-0.2.0 | lib/bio-bgzf/pack.rb |
bio-bgzf-0.1.1 | lib/bio-bgzf/pack.rb |