MCPcopy Create free account
hub / github.com/LagrangeDev/LagrangeGo / GZipCompress

Function GZipCompress

utils/binary/utils.go:49–57  ·  view source on GitHub ↗
(data []byte)

Source from the content-addressed store, hash-verified

47}
48
49func GZipCompress(data []byte) []byte {
50 gw := acquireGzipWriter()
51 _, _ = gw.Write(data)
52 _ = gw.Close()
53 ret := make([]byte, len(gw.buf.Bytes()))
54 copy(ret, gw.buf.Bytes())
55 releaseGzipWriter(gw)
56 return ret
57}
58
59func GZipUncompress(src []byte) []byte {
60 b := bytes.NewReader(src)

Callers 1

BuildMultiMsgUploadReqFunction · 0.92

Calls 5

acquireGzipWriterFunction · 0.85
releaseGzipWriterFunction · 0.85
BytesMethod · 0.80
WriteMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected