MCPcopy
hub / github.com/segmentio/kafka-go / readInt32Array

Function readInt32Array

describegroups.go:286–302  ·  view source on GitHub ↗

readInt32Array reads an array of int32s. It's adapted from the implementation of readStringArray.

(r *bufio.Reader, sz int, v *[]int32)

Source from the content-addressed store, hash-verified

284// readInt32Array reads an array of int32s. It's adapted from the implementation of
285// readStringArray.
286func readInt32Array(r *bufio.Reader, sz int, v *[]int32) (remain int, err error) {
287 var content []int32
288 fn := func(r *bufio.Reader, size int) (fnRemain int, fnErr error) {
289 var value int32
290 if fnRemain, fnErr = readInt32(r, size, &value); fnErr != nil {
291 return
292 }
293 content = append(content, value)
294 return
295 }
296 if remain, err = readArrayWith(r, sz, fn); err != nil {
297 return
298 }
299
300 *v = content
301 return
302}

Callers 2

decodeMemberMetadataFunction · 0.85
decodeMemberAssignmentsFunction · 0.85

Calls 2

readArrayWithFunction · 0.85
readInt32Function · 0.70

Tested by

no test coverage detected