Java extension with array slices