code: def write_int(fo, datum, schema=None):
      
      datum = (datum << 1) ^ (datum >> 63)
      while (datum & ~0x7F) != 0:
          fo.write(pack('B', (datum & 0x7f) | 0x80))
          datum >>= 7
      fo.write(pack('B', datum))
docs: int and long values are written using variable-length, zig-zag coding.