In the event there is outstanding a warrant for the arrest of the sheriff of the county issued by any justice of the peace, mayor, or any police justice in said county whereby the said sheriff has been charged by affidavit duly made before said justice of the peace, mayor, or police justice in said county for any misdemeanor or felony, any constable of the county, or any marshal or police officer of any municipality located in said county, may execute said warrant and arrest the said sheriff. In his failure to make bond in the amount as fixed by the justice of the peace, mayor or police justice where said affidavit was made, the officer making the arrest may confine said sheriff in a county jail adjoining the county of his residence, or in any other county jail in the state, and on the date of trial shall deliver him up to the court for trial. Said officer making the arrest shall be the jailer of said county during the confinement of the said sheriff in jail and/or while his cause on said criminal charge is pending for trial, provided the sheriff was jailer and living in the jail at the time of his arrest.