The defendant may, at the time of his arrest, instead of giving bail, deposit with the sheriff the amount mentioned in the order. The sheriff shall then give a certificate of the deposit to the defendant, who shall be discharged from custody.
N.C. Gen. Stat. § 1-426