public int foo(int size, int max) { try { size = (long) stream.available(); } catch (IOException e) {// toto /* empty block */ } return size; }