Jails shall be used for the detention of persons charged with crime and committed for trial, committed to secure their attendance as witnesses upon the trial of criminal causes, committed pursuant to a sentence upon conviction of crime or for any cause authorized by law, or detained or committed by the courts of the United States. Jails may also be used for the detention of persons arrested without a warrant and not admitted to bail pending appearance before the district court, provided that no adequately equipped lock-up established in accordance with the provisions of section thirty-four of chapter forty is available for the detention of such person.
Mass. Gen. Laws ch. 126, § 4