(trans, n)
| 49 | return (n >> 1) ^ -(n & 1) |
| 50 | |
| 51 | def writeVarint(trans, n): |
| 52 | out = [] |
| 53 | while True: |
| 54 | if n & ~0x7f == 0: |
| 55 | out.append(n) |
| 56 | break |
| 57 | else: |
| 58 | out.append((n & 0xff) | 0x80) |
| 59 | n = n >> 7 |
| 60 | trans.write(''.join(map(chr, out))) |
| 61 | |
| 62 | def readVarint(trans): |
| 63 | result = 0 |
no test coverage detected