Jinterface code cleanup

The Java code has been cleaned from warnings. There are many commits that handle separate issues, please let me know if they should be squashed together.

Some warnings have been eliminated by ignoring them, where it has been deemed safe to do so. For example in commit 7f0fec6, the JDK docs state that the close() is a no-op on ByteArray*Stream, and it would have made the code full of unrelated and unnecessary code.