The authentification should use the Connection#sendPacket method and work transparent with packets and packet listeners.
To support new connection types the authentification mechanisms shouldn't depend on the connetction's internal reader and writer.
I've merged the changes into the trunk. It was tested by a few people using the bosh branch.
The NullPointException was fixed by implementing SASL packets and using the transparent sendPacket method.