private static <T extends ArchiveEntry> void writeFileToTar(ArchiveOutputStream<T> taos, File baseDir, File file) throws IOException {
        taos.putArchiveEntry(taos.createArchiveEntry(file, baseDir.toPath().relativize(file.toPath()).toString()));
        try (FileInputStream inputStream = new FileInputStream(file)) {
            inputStream.transferTo(taos);
        }
        taos.closeArchiveEntry();
    }
Utility class for compressing and decompressing files used in a file reference

@author hmusum
filedistribution/src/main/java/com/yahoo/vespa/filedistribution/FileReferenceCompressor.java