Williams was taken into custody.
At an earlier court appearance counsel Nicola Graham said Williams was firmly entrenched in the judicial system.
"The only thing that made it possible for him to stay out of trouble was if he was in a stable relationship and he now has that."
His partner had made it clear that she would not stand by Williams if he did not stay out of trouble, Graham said.
Judge Large said at that earlier hearing Williams presented a letter to him.
"You wrote me a letter last time you were in court and that impressed me."
Judge Large said Williams had written that he was in a new relationship.
"You are lucky to have that support as you have some substantial difficulties," he told Williams.
He said there are reasons Williams became involved in the wrong things.
"One of those reasons is social acceptance, but you have to get on top of your drug issues."
Judge Large said he would take into consideration the effort Williams had made in writing the letter.
"It was the fact that you spoke so freely and frankly about where you are at and where you want to be."
However, Judge Large said the aggravating factor in the offending was that Williams was on home detention at the time.
Williams was sentenced to 17 months in prison followed by release conditions that he undergo a drug rehabilitation and addiction programme or similar, a relationship counselling programme and live at an approved address.
"This all sounds restrictive, but it is all designed to help you when you get out of prison," Judge Large told Williams.
In imposing the jail term Judge Large remitted Williams' outstanding fines of $529 and cancelled his outstanding 47.75 hours of community work.