I wrote a utility class to encode OGG Vorbis audio files from Java, using the xiph Java ports of libogg and libvorbis.
This is used when we are beginning with an array of floating point samples, as opposed to converting an integer based .WAV file, as in the original xiph example.
I hope this is helpful to the community.
https://github.com/xjmusic/java-vorbis-encoder/blob/master/VorbisEncoder.java