This PR attempts to fix a bug which may lead to incomplete data loading from a resource file. In particular, the old Java code
byte[] data = new byte[is.available()];
is.read(data);
does not guarantee that we read every byte from the input stream. If the data file is only partially loaded into the byte array, it will result in data corruption, and consequently either invalid SHAP values, or more severe runtime errors.
The bugfix included in this PR should ensure that we exhaustively read all bytes from a given resource file.
Overview
This PR attempts to fix a bug which may lead to incomplete data loading from a resource file. In particular, the old Java code
does not guarantee that we read every byte from the input stream. If the data file is only partially loaded into the byte array, it will result in data corruption, and consequently either invalid SHAP values, or more severe runtime errors.
The bugfix included in this PR should ensure that we exhaustively read all bytes from a given resource file.