A former NSW homicide detective accused of illegally recording conversations during the investigation into missing toddler William Tyrrell could have the case against him heard behind closed doors, a court has been told.

Gary Jubelin, 57, was charged in June last year with four counts of using a device to record a conversation to which he was party, which can be unlawful under the Surveillance Devices Act.

Former NSW detective Gary Jubelin and his barrister Margaret Cunneen, SC, outside court on Monday. Credit:AAP

It is alleged he recorded four conversations with a person linked to the investigation into William, who was three years old when he vanished from his grandmother's home at Kendall on the NSW Mid North Coast in September 2014.

Mr Jubelin has pleaded not guilty and says he had a legitimate operational purpose for the recordings.