// ReadKVBuffer converts an arg2 buffer to a string map
ReadKVBuffer converts an arg2 buffer to a string map
// ReadKVBuffer converts an arg2 buffer to a string map
func ReadKVBuffer(b []byte) (map[string]string, error) {
	rbuf := typed.NewReadBuffer(b)
	nh := rbuf.ReadUint16()
	retMap := make(map[string]string, nh)
	for i := uint16(0); i < nh; i++ {
		key := rbuf.ReadLen16String()
		val := rbuf.ReadLen16String()
		retMap[key] = val
	}
	if rbuf.BytesRemaining() > 0 {
		return nil, fmt.Errorf("kv buffer wasn't fully consumed (%d bytes remaining)", rbuf.BytesRemaining())
	}
	return retMap, nil
}
func ReadKVBuffer ( b [ ] byte ) ( map [ string ] string , error ) { rbuf := typed . NewReadBuffer ( b ) nh := rbuf . ReadUint16 ( ) retMap := make ( map [ string ] string , nh ) for i := uint16 ( 0 ) ; i < nh ; i ++ { key := rbuf . ReadLen16String ( ) val := rbuf . ReadLen16String ( ) retMap [ key ] = val } if rbuf . BytesRemaining ( ) > 0 { return nil , fmt . Errorf ( " " , rbuf . BytesRemaining ( ) ) } return retMap , nil }
ReadKVBuffer converts an arg2 buffer to a string map
ReadKVBuffer converts an arg2 buffer to a string map