Throws IOException to prevent throwing UndeclaredThrowableException.