You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: primitives.go
    path of file: ./repos/franz-go/pkg/kbin
    
    the code of the file until where you have to start completion: // Package kbin contains Kafka primitive re
    
func (b *Reader) CompactArrayLen() int32 {
	r := int32(b.Uvarint()) - 1
	// The min size of a Kafka type is a byte, so if we do not have
	// at least the array length of bytes left, it is bad.
	if len(b.Src) < int(r) {
		b.bad = true
		b.Src = nil
		return 0
	}
	return r
}