Finish the java send code.
Fix some style.