private long getPos() throws IOException { if (reader != null) { return readBytes + reader.getReadBytes(); } else { return readBytes; } }
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; } } }