Commit 72f95a2f authored by Kishen Maloor's avatar Kishen Maloor

Fix impl of IORepository::getBytesFromFile()

Signed-off-by: Kishen Maloor's avatarKishen Maloor <kishen.maloor@intel.com>
parent 50d2d473
......@@ -95,8 +95,10 @@ public class IORepository {
return Single.fromCallable(() -> {
byte[] fileBytes;
try (InputStream inputStream = new FileInputStream(OtgcConstant.DATA_PATH + path)) {
fileBytes = new byte[inputStream.available()];
int numBytes = inputStream.available() + 1;
fileBytes = new byte[numBytes];
inputStream.read(fileBytes);
fileBytes[numBytes - 1] = '\0';
}
return fileBytes;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment