getClass().getResourcesAsStream()
works fine on Android. Just make sure the file you are trying to open is correctly embedded in your APK (open the APK as ZIP).
Normally on Android you put such files in the assets
directory. So if you put the raw_resources.dat
in the assets
subdirectory of your project, it will end up in the assets
directory in the APK and you can use:
getClass().getResourcesAsStream("/assets/raw_resources.dat");
It is also possible to customize the build process so that the file doesn't land in the assets
directory in the APK.