(1)
Where any person is confined in a prison in a State,—
(a) under sentence of death, or
(b) under or in lieu of, a sentence of imprisonment or transportation, or
(c) in default of payment of a fine, or
(d) in default of giving security for keeping the peace or for maintaining good behaviour;
(2)
The officer in charge of the prison to which any person is removed under sub-section (1) shall receive and detain him, so far as may be, according to the exigency of any writ, warrant or order of the court by which such person has been committed or until such person is discharged or removed in due course of law.