Added Java files.
Writer null-check moved after the programmatically QoS code.
Merge pull request #25 from jmlvega/master

Java example added.