HDF5 dataset casting problem- reg

I tried to read HDF5 file in java.When i tried to cast scalar dataset to integer array i got exception:

Exception in thread "main" java.lang.ClassCastException: [S cannot be cast to [I

Image data contained in scalar dataset.
So please suggest me how to cast dataset to integer array which contains image data.

Thanks in advance

M.Suresh Kumar