coreos/gzran

Name: gzran

Owner: CoreOS

Description: gzip indexer for random access into compressed files

Created: 2015-03-11 17:41:34.0

Updated: 2018-05-18 01:55:09.0

Pushed: 2018-01-04 20:27:06.0

Homepage: null

Size: 9857

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

gzran

Gzran is a package that reads arbitrary offsets of uncompresssed data from compressed gzip files. This is accomplished by first inflating a file and saving decompressor state into memory. Then, the built index can be used with the Extract function to read from the compressed file without fully inflating the file.

Gzran is based on the c library, zran, by Mark Adler: https://github.com/madler/zlib/blob/master/examples/zran.c

example
 err := gzran.BuildIndex(gzippedFileName)
rr != nil {
panic(err)

rr := gzran.Extract(gzippedFileName, idx, fileOffset, readLength)
rr != nil && err != io.EOF {
panic(err)


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.