def to_string(byte_array):
    """
    Converts the given byte array to a String.

    :param byte_array: The byte array to be converted to a String.
    :return: The String represented by the given bytes.
    """
    result = None
    if byte_array is not None:
        result = byte_array.decode("utf-8")
    return result