Merge pull request #342 from datastax/329
PYTHON-329 - Update custom payload value encoding for CASSADNRA-9515
This commit is contained in:
@@ -1019,11 +1019,6 @@ def read_binary_string(f):
|
|||||||
return contents
|
return contents
|
||||||
|
|
||||||
|
|
||||||
def write_binary_string(f, s):
|
|
||||||
write_short(f, len(s))
|
|
||||||
f.write(s)
|
|
||||||
|
|
||||||
|
|
||||||
def write_string(f, s):
|
def write_string(f, s):
|
||||||
if isinstance(s, six.text_type):
|
if isinstance(s, six.text_type):
|
||||||
s = s.encode('utf8')
|
s = s.encode('utf8')
|
||||||
@@ -1080,7 +1075,7 @@ def read_bytesmap(f):
|
|||||||
bytesmap = {}
|
bytesmap = {}
|
||||||
for _ in range(numpairs):
|
for _ in range(numpairs):
|
||||||
k = read_string(f)
|
k = read_string(f)
|
||||||
bytesmap[k] = read_binary_string(f)
|
bytesmap[k] = read_value(f)
|
||||||
return bytesmap
|
return bytesmap
|
||||||
|
|
||||||
|
|
||||||
@@ -1088,7 +1083,7 @@ def write_bytesmap(f, bytesmap):
|
|||||||
write_short(f, len(bytesmap))
|
write_short(f, len(bytesmap))
|
||||||
for k, v in bytesmap.items():
|
for k, v in bytesmap.items():
|
||||||
write_string(f, k)
|
write_string(f, k)
|
||||||
write_binary_string(f, v)
|
write_value(f, v)
|
||||||
|
|
||||||
|
|
||||||
def read_stringmultimap(f):
|
def read_stringmultimap(f):
|
||||||
|
|||||||
Reference in New Issue
Block a user