Skip to content
This repository has been archived by the owner on Sep 22, 2020. It is now read-only.
/ gzran Public archive

gzip indexer for random access into compressed files

License

Notifications You must be signed in to change notification settings

coreos/gzran

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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

About

gzip indexer for random access into compressed files

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages