public static void addInputStreamToTar(TarArchiveOutputStream tarStream, InputStream inputStream, String path,
	                                       long size, int mode) throws IOException {
		TarArchiveEntry entry = new TarArchiveEntry(path);
		entry.setSize(size);
		entry.setMode(mode);
		try {
			tarStream.putArchiveEntry(entry);
			IOUtils.copy(inputStream, tarStream);
		} catch (IOException e) {
			throw processException("Error while adding File to Tar file", e);
		} finally {
			tarStream.closeArchiveEntry();
		}
	}
Add the given input stream into tar.

@param tarStream   TarArchive outputStream
@param inputStream input stream
@param path        relative path to append
@param size        size of stream
@param mode        mode for this entry
@throws IOException thrown when having IO problem.
ngrinder-core/src/main/java/org/ngrinder/common/util/CompressionUtils.java