def _read_vector(instream, structure, name):
    """Reads a vector from the instream and returns it as a tuple."""
    try:
        v = instream.read(structure.size)
        vector = structure.unpack(v)
        return vector
    except Exception as e:
        raise RuntimeError("Failed to read vector " +
                           "{} // {}".format(name, str(e)))