The footer is an empty gzip stream with no compression and an Extra header.
46 comes from:
10 bytes gzip header 2 bytes XLEN (length of Extra field) = 21 (4 bytes header + len("STARGZEXTERNALTOC")) 2 bytes Extra: SI1 = 'S', SI2 = 'G' 2 bytes Extra: LEN = 17 (len("STARGZEXTERNALTOC")) 17 bytes Extra: subfield = "STARGZEXTERNALTOC" 5 bytes flate header 8 bytes gzip footer (End of the eStargz blob)
const
= 46func NewGzipCompressionWithLevel(provideTOC func() ([]byte, error), level int) estargz.Compression
type GzipCompression struct { *GzipCompressor *GzipDecompressor }
type GzipCompressor struct {
// contains filtered or unexported fields
}
func NewGzipCompressor() *GzipCompressor
func NewGzipCompressorWithLevel(level int) *GzipCompressor
func (gc *GzipCompressor) WriteTOCAndFooter(w io.Writer, off int64, toc *estargz.JTOC, diffHash hash.Hash) (digest.Digest, error)
func (gc *GzipCompressor) WriteTOCTo(w io.Writer) (int, error)
func (gc *GzipCompressor) Writer(w io.Writer) (estargz.WriteFlushCloser, error)
type GzipDecompressor struct {
// contains filtered or unexported fields
}
func NewGzipDecompressor(provideTOCFunc func() ([]byte, error)) *GzipDecompressor
func (gz *GzipDecompressor) DecompressTOC(r io.Reader) (tocJSON io.ReadCloser, err error)
func (gz *GzipDecompressor) FooterSize() int64
func (gz *GzipDecompressor) ParseFooter(p []byte) (blobPayloadSize, tocOffset, tocSize int64, err error)
func (gz *GzipDecompressor) ParseTOC(r io.Reader) (toc *estargz.JTOC, tocDgst digest.Digest, err error)
func (gz *GzipDecompressor) Reader(r io.Reader) (io.ReadCloser, error)