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

Function encodeBlock

s2/encode_go.go:19–27  ·  view source on GitHub ↗

encodeBlock encodes a non-empty src to a guaranteed-large-enough dst. It assumes that the varint-encoded length of the decompressed bytes has already been written. It also assumes that: len(dst) >= MaxEncodedLen(len(src))

(dst, src []byte)

Source from the content-addressed store, hash-verified

17//
18// len(dst) >= MaxEncodedLen(len(src))
19func encodeBlock(dst, src []byte) (d int) {
20 if len(src) < minNonLiteralBlockSize {
21 return 0
22 }
23 if len(src) <= 64<<10 {
24 return encodeBlockGo64K(dst, src)
25 }
26 return encodeBlockGo(dst, src)
27}
28
29// encodeBlockBetter encodes a non-empty src to a guaranteed-large-enough dst. It
30// assumes that the varint-encoded length of the decompressed bytes has already

Callers 2

EncodeFunction · 0.70
encodeBlockMethod · 0.70

Calls 2

encodeBlockGo64KFunction · 0.85
encodeBlockGoFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…