Skip to content

Commit

Permalink
treat failure to read resource as RuntimeException
Browse files Browse the repository at this point in the history
  • Loading branch information
thestinger committed Oct 1, 2024
1 parent 3c6f3e4 commit d2d8db8
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -525,9 +525,11 @@ private static byte[] getChallengeIndex(final Context context) {
}
}

private static byte[] readRawResource(final Context context, final int id) throws IOException {
private static byte[] readRawResource(final Context context, final int id) {
try (final InputStream stream = context.getResources().openRawResource(id)) {
return ByteStreams.toByteArray(stream);
} catch (final IOException e) {
throw new RuntimeException(e);
}
}

Expand Down

0 comments on commit d2d8db8

Please sign in to comment.