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

Function byteArrayEncodeFuncOf

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

Source from the content-addressed store, hash-verified

154}
155
156func byteArrayEncodeFuncOf(n int) encodeFunc {
157 return func(b []byte, p unsafe.Pointer, flags flags) (int, error) {
158 if p != nil {
159 if v := makeBytes(p, n); flags.has(wantzero) || !isZeroBytes(v) {
160 return encodeBytes(b, unsafe.Pointer(&v), noflags)
161 }
162 }
163 return 0, nil
164 }
165}
166
167func byteArrayDecodeFuncOf(n int) decodeFunc {
168 return func(b []byte, p unsafe.Pointer, _ flags) (int, error) {

Callers 1

byteArrayCodecOfFunction · 0.85

Calls 4

makeBytesFunction · 0.85
isZeroBytesFunction · 0.85
encodeBytesFunction · 0.70
hasMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…