@Override public void close() throws IOException { if (totalRead == fileSize) { callback.finish(); } else { callback.failed(); } super.close(); }