If the prisoner is detained for a cause or crime for which he is bailable, he shall be admitted to bail if sufficient bail is offered; and if not, he shall be remanded with an order of the court or justice expressing the amount in which he shall be held to bail and the court at which he shall be required to appear; and any magistrate authorized to admit to bail may, at any time before the sitting of said court, bail the prisoner pursuant to such order.
Mass. Gen. Laws ch. 248, § 19