def write_length(l, o):
    """ Put a 32-bit length into four bytes in o

    Equivalent to struct.pack('<i', l), but suitable for numba-jit
    """
    right_byte_mask = 255
    for _ in range(4):
        o.write_byte(l & right_byte_mask)
        l >>= 8
