MCPcopy Create free account
hub / github.com/apache/cassandra-python-driver / write_uint_le

Function write_uint_le

cassandra/protocol.py:1303–1312  ·  view source on GitHub ↗

Write an unsigned integer on a sequence of little endian bytes.

(f, i, size=4)

Source from the content-addressed store, hash-verified

1301
1302
1303def write_uint_le(f, i, size=4):
1304 """
1305 Write an unsigned integer on a sequence of little endian bytes.
1306 """
1307 if size == 4:
1308 f.write(uint32_le_pack(i))
1309 else:
1310 for j in range(size):
1311 shift = j * 8
1312 write_byte(f, i >> shift & 0xFF)
1313
1314
1315def write_int(f, i):

Callers 2

encode_headerMethod · 0.90
_encode_segmentMethod · 0.90

Calls 1

write_byteFunction · 0.85

Tested by

no test coverage detected