java: add new read(byte []buf); method

which calculates length implicitly. This avoids the expensive
fallback to java.io (which calls the inefficient per-byte read() method)

Signed-off-by: Anand Avati <avati@redhat.com>