District courts may require persons found guilty of any crime within their final jurisdiction, except a violation of by-laws, orders, ordinances, rules and regulations, made by cities, towns and public officers, or of the laws and regulations relative to the public health or relative to defective highways, in addition to the punishment prescribed by law, to recognize with sureties, in a reasonable sum, to keep the peace or be of good behavior, or both, for not more than one year, and to stand committed until they so recognize. Sections thirteen, sixteen and seventeen of chapter two hundred and seventy-five shall apply to recognizances so taken.
Mass. Gen. Laws ch. 218, § 28