// NewKeyValIterator inits a KeyValIterator with the buffer pointing at
// start of Arg2. Return io.EOF if no iterator is available.
// NOTE: tchannel-thrift Arg Scheme starts with number of key/value pair.
NewKeyValIterator inits a KeyValIterator with the buffer pointing at
start of Arg2. Return io.EOF if no iterator is available.
NOTE: tchannel-thrift Arg Scheme starts with number of key/value pair.
// NewKeyValIterator inits a KeyValIterator with the buffer pointing at // start of Arg2 . Return io . EOF if no iterator is available . // NOTE : tchannel - thrift Arg Scheme starts with number of key / value pair .
func NewKeyValIterator(arg2Payload []byte) (KeyValIterator, error) {
	if len(arg2Payload) < 2 {
		return KeyValIterator{}, io.EOF
	}
	leftPairCount := binary.BigEndian.Uint16(arg2Payload[0:2])
	return KeyValIterator{
		leftPairCount: int(leftPairCount),
		remaining:     arg2Payload[2:],
	}.Next()
}
func NewKeyValIterator ( arg2Payload [ ] byte ) ( KeyValIterator , error ) { if len ( arg2Payload ) < 2 { return KeyValIterator { } , io . EOF } leftPairCount := binary . BigEndian . Uint16 ( arg2Payload [ 0 : 2 ] ) return KeyValIterator { leftPairCount : int ( leftPairCount ) , remaining : arg2Payload [ 2 : ] , } . Next ( ) }
NewKeyValIterator inits a KeyValIterator with the buffer pointing at
start of Arg2.
NewKeyValIterator inits a KeyValIterator with the buffer pointing at start of Arg2 .