// BuildKVBuffer builds an thrift Arg2 KV buffer.
BuildKVBuffer builds an thrift Arg2 KV buffer.
// BuildKVBuffer builds an thrift Arg2 KV buffer .
func BuildKVBuffer(kv map[string]string) []byte {
	var bufSize int
	for k, v := range kv {
		bufSize += 2 + len(k) + 2 + len(v)
	}
	bufSize += 2 
	buf := make([]byte, bufSize)
	wb := typed.NewWriteBuffer(buf)
	wb.WriteUint16(uint16(len(kv)))
	for k, v := range kv {
		wb.WriteLen16String(k)
		wb.WriteLen16String(v)
	}
	return buf[:wb.BytesWritten()]
}
func BuildKVBuffer ( kv map [ string ] string ) [ ] byte { var bufSize int for k , v := range kv { bufSize += 2 + len ( k ) + 2 + len ( v ) } bufSize += 2 buf := make ( [ ] byte , bufSize ) wb := typed . NewWriteBuffer ( buf ) wb . WriteUint16 ( uint16 ( len ( kv ) ) ) for k , v := range kv { wb . WriteLen16String ( k ) wb . WriteLen16String ( v ) } return buf [ : wb . BytesWritten ( ) ] }
BuildKVBuffer builds an thrift Arg2 KV buffer.
BuildKVBuffer builds an thrift Arg2 KV buffer .
// Scan once to know size of buffer // k~2 v~2 // nh:2