That is an incredibly difficult situation and one I can relate to. A few years ago, I really hit it off with a guy online. He happened to be a good friend of my best friend, who he was in love with at the time. I kept my friendship with him strictly online (including voice) and we became pretty close. I was reluctant to move forward and see him, and this really, deeply frustrated him. I thought about cutting off all contact as I couldn't bring myself to tell him. Eventually, I had my best friend deliver the message. His response: "I understand, but unfortunately, I'm not interested in men." -- she gave him a very hard time over that.
We continued our friendship and he quickly understood that I was a woman, but the interest never really came back. He considered the prospect off and on, but it was too difficult for him to get over. In the end, I'm glad, because I realized he wasn't for me even outside of that issue.
It did teach me to be honest about my constitution the moment I start developing feelings. However, if I were to do it again, I would still avoid cutting him off altogether: because I had feelings for him, I gave up a bit of my humanity in his eyes in order to give him peace of mind. It was incredibly difficult to do and I came very close to simply disappearing from his life, as I had been working toward vanishing for over a month. I think few other things would have made sense to him, as we were getting along extremely well.
If I had had sex with a guy before telling him, if I thought he might be violent, if I thought he might try to ruin my reputation or relationships, I would likely resort to the disappearing act. If I'm sure that his reaction will only be deciding not to be with me, though? It'd be hard, but I'd share. It would be too much guilt for me not to give a benign human being peace of mind.
As an additional note, I am currently with a man who I consider to be impossibly fantastic. I told him early, but I was terrified that he would reject me. He is easily the best prospective partner I have ever met and I was certain that he would turn me away upon finding out, but he didn't. In general, I've found that the best men have a high tendency to get over it.