Merge pull request #163 from csoroiu/master

[Java]: avoid unintended or evil buffer overrun and an eventual jvm crash
[Java]: Minor tidy up of PR for DirectBuffer bounds check and non-native byte order testing.