An electronics specialist said he told a federal grand jury yesterday that he has made "electronic sweeps" of Mayor Marion Barry's office for possible bugs or wiretaps as part of consulting work he did with a private electronic security and executive protection firm hired by the city.

Eddie T. Dockery, who testified before a grand jury investigating District government contracting, said in an interview later that he was paid to make electronic searches of Barry's offices, other District offices and some non-District locations, after he made similar sweeps of Barry's home as a "personal favor."

Dockery's testimony is the first disclosure that the city hired a specialized company to make such electronic searches, which a law enforcement source said could have been done by the special D.C. police unit that regularly installs court-ordered wiretaps and bugs.

A police official said that if D.C. officers had done the searches and had located any listening device or wiretap they would have been obliged to contact the U.S. attorney's office because interference with court-ordered surveillance could be considered obstruction of justice.

Dockery said that in the electronic sweeps of Barry's home beginning in early 1984 he had found there was a "90 percent probability" that the three telephone lines into Barry's house were wiretapped and that the rooms were bugged.

The U.S. attorney's office, in an unusual move, later issued a statement saying that if Barry's home, office or car was wiretapped or bugged, it was not done by federal officials. A D.C. police source said no wiretapping had been done by the police department.

Barry could not be reached for comment last night and his attorney, Herbert O. Reid Sr., said he did not know Dockery and was not aware of any work that Dockery may have done for the mayor. Reid said, however, that the mayor sometimes gets outside advice.

Dockery, who spent about an hour being questioned before the grand jury by Assistant U.S. Attorney Daniel Bernstein, said the mayor first contacted him in early 1984 about checking to see if his home telephones might have been tapped. Dockery said he did not know what prompted Barry to suspect his telephones might have been tapped.

Dockery, who said he spent nine years in the Army specializing in the installation and maintenance of secure data equipment, recalled meeting Barry through his sister shortly after coming to the District in 1977.

Dockery said his sister, whom he declined to identify, had known Barry in college and that Barry had learned of Dockery's electronics expertise through the sister.

Dockery said that after he made several sweeps of Barry's house as a personal favor, a police official wanted him to "work through a regular company." Subsequently, he said, he made sweeps of Barry's office and other District locations as a consultant for Mele and Associates, which he described as a firm hired by the city for electronic security and executive protection. Officials of the firm could not be reached for comment last night.

During the first electronic sweep of Barry's Southeast Washington home in 1984, Dockery said that he found a "90 percent probability" that the two regular telephone lines entering the residence had been tapped, along with the special telephone hookup to the Mayor's Command Center.

Dockery said he also found evidence that all the rooms in Barry's home were bugged, either through bugs inside the residence or some type of sophisticated outside surveillance.

Dockery said he made no attempt to locate the listening devices because he didn't want to be accused of obstruction of justice.

"I'm not there to tell them who's doing it," Dockery said. "I'm there to tell him the probability of the chances of a listening device on his phone."

Also in early 1984, Dockery said, he conducted similar electronic searches of Barry's car and his office. He said he found no evidence of a bug in Barry's car but said there was a "high probability" that Barry's car telephone was bugged.

Dockery said the telephone system in the mayor's District Building office was so antiquated that checks of phone lines were inconclusive.

Dockery said he checked Barry's home telephone lines about a half-dozen times, the last of which was last September, and that each was done as a personal favor to Barry. He said he was never paid for the searches.

Dockery said that each check showed evidence that Barry's telephones were tapped and the rooms were bugged.

"It's a terrible situation for a person to have to live with," Dockery said, explaining why he undertook the searches.

Dockery said he was questioned before the grand jury about whether his own firm, B.C.D. Cable Corp., had received any city contracts or subcontracts. He said the firm, which installs and maintains computer cabling, had never done any work for the city.

Later yesterday, Virginia businessman Charles Anderson testified concerning his relationship with D.C. businessman John B. Clyburn before another federal grand jury investigating District contracting.

Anderson, who said his main business is real estate but that he had arranged some printing work for Clyburn, was questioned for about an hour and 45 minutes.

Anderson said he was not asked about the mayor during the session. Staff writers Sharon LaFraniere and Tom Sherwood contributed to this report.