Compressing folder into 7z in java
<p>I want to compress a folder into .7z extension using java. Iam trying using the below code but it is creating a new file and appending all the source files content into one single file. Can anyone please help me to be out of this problem.....</p>

<pre><code>Encoder encoder = new Encoder();
encoder.SetAlgorithm(2);
encoder.SetDictionarySize(8388608);
encoder.SetNumFastBytes(128);
encoder.SetMatchFinder(1);
encoder.SetLcLpPb(3,0,2);
encoder.SetEndMarkerMode(false);
encoder.WriteCoderProperties(outStream);
long fileSize;
fileSize = inputToCompress.length();
for (int i = 0; i &lt; 8; i++)                                     
{
        outStream.write((int)(fileSize &gt;&gt;&gt; (8 * i)) &amp; 0xFF);
}                               

encoder.Code(inStream, outStream, -1, -1, null);
</code></pre>