Refactor _check_array() out of _read_or_write()