In this example we are going to convert a zipped file into exe.
To convert a Zip file into .exe file pass the name of a zip file using command line arguments. Use FileInputStream to take the zipped file as input. Read the file from the system, unzip the file and store the data of this file into a byte array. Create another file with .exe extension. Write the byte formatted data of the unzip file into .exe file.
Create FileOutputStream object pass the
name of file with .exe extension for creating an exe file. ZipInputStream
allows modification on zipped (or unzipped) file. Use getNextEntry() method
to set the entry point of the zip
file. Create an array of bytes which stores the data of
unzipped file and finally write the data into exe file.
Here is the code of the program :
Liked it! Share this Tutorial