finally block to close input stream

This commit is contained in:
Tebbe Ubben 2019-05-01 16:25:41 +02:00
parent de64b1ecf7
commit a2d108b4c4

View file

@ -165,6 +165,7 @@ public class SignatureVerifier extends PluginBase implements ConstraintsInterfac
}
private String readInputStream(InputStream inputStream) throws IOException {
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
int read;
@ -172,8 +173,10 @@ public class SignatureVerifier extends PluginBase implements ConstraintsInterfac
baos.write(buffer, 0, read);
}
baos.flush();
inputStream.close();
return new String(baos.toByteArray(), StandardCharsets.UTF_8);
} finally {
inputStream.close();
}
}
private String readRevokedCertsInAssets() throws IOException {