Java: improve access to Java arrays.