try {
IOUtils.copy(input, tOut); // copy with 8K buffer, not close
} finally {
input.close();
}
tOut.closeArchiveEntry();
}
tOut.close(); // finishes inside
} finally {
// TarArchiveOutputStream seemed not to close files properly in error situation
org.apache.hadoop.io.IOUtils.closeStream(out);