Q:

Converting InputStream to FileInputStream Not Working for Apache POI

I am trying to access an excel file from my res/raw folder, and I know that you can only really do this using an InputStream; however, the XSSFWorkbook commands in Apache POI only take FileInputStreams and not InputStreams: is there any way to do this?  I've tried using the following code but go this error:   java.lang.NullPointerException: Attempt to invoke virtual method 'java.net.URI java.net.URL.toURI()' on a null object reference
Here is the code I've tried using:
     URL ins = this.getClass().getResource("ncaa.xlsx");
 FileInputStream file = new FileInputStream(new File(ins.toURI()));
 XSSFWorkbook workbook = new XSSFWorkbook(file);

A:

is there any way to do this?

Copy the raw resource out to a file, then open the file and hand the FileInputStream over to the library.

I've tried using the following 

getResource() has nothing to do with Android resources. To access an InputStream on a raw resource, use getResources().openRawResource(), called on your Activity or other handy Context.

