MCPcopy
hub / github.com/valyala/fasthttp / writeUnzstd

Function writeUnzstd

zstd.go:145–158  ·  view source on GitHub ↗
(w io.Writer, p []byte, maxBodySize int)

Source from the content-addressed store, hash-verified

143}
144
145func writeUnzstd(w io.Writer, p []byte, maxBodySize int) (int, error) {
146 r := &byteSliceReader{b: p}
147 zr, err := acquireZstdReader(r)
148 if err != nil {
149 return 0, err
150 }
151 n, err := copyZeroAllocWithLimit(w, zr, maxBodySize)
152 releaseZstdReader(zr)
153 nn := int(n)
154 if int64(nn) != n {
155 return 0, fmt.Errorf("too much data unzstd: %d", n)
156 }
157 return nn, err
158}
159
160// AppendUnzstdBytes appends unzstd src to dst and returns the resulting dst.
161func AppendUnzstdBytes(dst, src []byte) ([]byte, error) {

Callers 2

WriteUnzstdFunction · 0.85
unzstdDataFunction · 0.85

Calls 3

acquireZstdReaderFunction · 0.85
copyZeroAllocWithLimitFunction · 0.85
releaseZstdReaderFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…