Documentation ¶
Overview ¶
Package gzran is a go implementation of zran by Mark Adler: https://github.com/madler/zlib/blob/master/examples/zran.c Gzran indexes a gzip file with access points about every span bytes into the uncompressed output. The compressed file can be read from randomly once an index has been built, having to decompress on the average SPAN/2 uncompressed bytes before getting to the desired block of data.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Index ¶
type Index []*point
Index stores access points into compressed file. Span will determine the balance between the speed of random access against the memory requirements of the index.
func BuildIndex ¶
BuildIndex decompresses given file and builds an index that records the state of the gzip decompresser every span bytes into the uncompressed data. This index can be used to randomly read uncompressed data from the compressed file. Data after the end of the first gzip stream in the file is ignored and so concatenated gzip files are not supported.
Directories ¶
Path | Synopsis |
---|---|
Package flate implements the DEFLATE compressed data format, described in RFC 1951.
|
Package flate implements the DEFLATE compressed data format, described in RFC 1951. |
Package gzip implements reading and writing of gzip format compressed files, as specified in RFC 1952.
|
Package gzip implements reading and writing of gzip format compressed files, as specified in RFC 1952. |