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

Function WriteZstdLevel

zstd.go:94–113  ·  view source on GitHub ↗
(w io.Writer, p []byte, level int)

Source from the content-addressed store, hash-verified

92}
93
94func WriteZstdLevel(w io.Writer, p []byte, level int) (int, error) {
95 level = normalizeZstdCompressLevel(level)
96 switch w.(type) {
97 case *byteSliceWriter,
98 *bytes.Buffer,
99 *bytebufferpool.ByteBuffer:
100 ctx := &compressCtx{
101 w: w,
102 p: p,
103 level: level,
104 }
105 stacklessWriteZstd(ctx)
106 return len(p), nil
107 default:
108 zw := acquireStacklessZstdWriter(w, level)
109 n, err := zw.Write(p)
110 releaseStacklessZstdWriter(zw, level)
111 return n, err
112 }
113}
114
115var (
116 stacklessWriteZstdOnce sync.Once

Callers 1

AppendZstdBytesLevelFunction · 0.85

Calls 5

stacklessWriteZstdFunction · 0.85
WriteMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…