Upon petition by the sheriff alleging that:
the court may order inmates transferred to the custody of the person who has agreed to accept custody. Whenever a transfer order is necessary under this section, only inmates serving a sentence after conviction for a crime may be transferred, unless the overcrowding or inadequacy of the facility also requires transfer of inmates awaiting trial or sentencing.
IC 35-33-11-3