A drug dealer who bit a police officer and attacked two others has been jailed for more than four years.