The Warden of the jail shall receive and confine in such jail, until discharged by due course of law, all persons committed to such jail by any competent authority.
When there is no county jail facility operating in a county, arresting agencies shall be responsible for delivering persons arrested to an adjoining county jail facility, if the adjoining county has entered into a written agreement with the committing county allowing for the maintenance of committed persons in the adjoining county.
730 ILCS 125/4