private void closeReader() throws IOException { if (reader != null) { try { readBytes += reader.getReadBytes(); reader.close(); } catch (Exception e) { // not much to do here but skip the task } finally { reader = null; } } }
@Override public synchronized void close() throws IOException { if (reader != null) { reader.close(); } }