MCPcopy
hub / github.com/klauspost/compress / Encode

Function Encode

snappy/encode.go:20–22  ·  view source on GitHub ↗

Encode returns the encoded form of src. The returned slice may be a sub- slice of dst if dst was large enough to hold the entire encoded block. Otherwise, a newly allocated slice will be returned. The dst and src must not overlap. It is valid to pass a nil dst. Encode handles the Snappy block form

(dst, src []byte)

Source from the content-addressed store, hash-verified

18//
19// Encode handles the Snappy block format, not the Snappy stream format.
20func Encode(dst, src []byte) []byte {
21 return s2.EncodeSnappyBetter(dst, src)
22}
23
24// MaxEncodedLen returns the maximum length of a snappy block, given its
25// uncompressed length.

Callers 4

roundtripFunction · 0.70
benchDecodeFunction · 0.70
benchEncodeFunction · 0.70

Calls 1

EncodeSnappyBetterFunction · 0.92

Tested by 4

roundtripFunction · 0.56
benchDecodeFunction · 0.56
benchEncodeFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…