This post demonstrates a simple example for how to compress your file and add to the ZIP file. Java has built-in API java.util.zip for compressing the files in ZIP format. It is very simple to read the files from your disk and writing to the destination ZIP file. It is straight forward. The steps involved …