GUACAMOLE-362: Remove unnecessary IOException catch.

This commit is contained in:
Nick Couchman
2017-10-27 13:45:25 -04:00
parent b968e073c2
commit ad8820cf05

View File

@@ -56,13 +56,9 @@ public abstract class PrivateKeyGuacamoleProperty implements GuacamoleProperty<P
FileInputStream keyStreamIn = new FileInputStream(keyFile);
ByteArrayOutputStream keyStreamOut = new ByteArrayOutputStream();
byte[] keyBuffer = new byte[1024];
try {
for (int readBytes; (readBytes = keyStreamIn.read(keyBuffer)) != -1;)
keyStreamOut.write(keyBuffer, 0, readBytes);
}
catch (IOException e) {
throw new GuacamoleServerException("IOException while trying to read bytes from file.", e);
}
for (int readBytes; (readBytes = keyStreamIn.read(keyBuffer)) != -1;)
keyStreamOut.write(keyBuffer, 0, readBytes);
final byte[] keyBytes = keyStreamOut.toByteArray();