MCPcopy Create free account
hub / github.com/segmentio/encoding / byteArrayDecodeFuncOf

Function byteArrayDecodeFuncOf

proto/bytes.go:167–177  ·  view source on GitHub ↗
(n int)

Source from the content-addressed store, hash-verified

165}
166
167func byteArrayDecodeFuncOf(n int) decodeFunc {
168 return func(b []byte, p unsafe.Pointer, _ flags) (int, error) {
169 v, r, err := decodeVarlen(b)
170 if err == nil {
171 if copy(makeBytes(p, n), v) != n {
172 err = fmt.Errorf("cannot decode byte sequence of size %d into byte array of size %d", len(v), n)
173 }
174 }
175 return r, err
176 }
177}

Callers 1

byteArrayCodecOfFunction · 0.85

Calls 2

decodeVarlenFunction · 0.85
makeBytesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…