title: How to create zip with lzma compression
body: <p>I know how to create zip archive:</p>
  
  <pre><code>import java.io.*;
  import java.util.zip.*;
  public class ZipCreateExample{
      public static void main(String[] args)  throws Exception  
          // input file 
          FileInputStream in = new FileInputStream("F:/sometxt.txt");
  
          // out put file 
          ZipOutputStream out = new ZipOutputStream(new FileOutputStream("F:/tmp.zip"));
  
          // name the file inside the zip  file 
          out.putNextEntry(new ZipEntry("zippedjava.txt")); 
  
          // buffer size
          byte[] b = new byte[1024];
          int count;
  
          while ((count = in.read(b)) &gt; 0) {
              System.out.println();
              out.write(b, 0, count);
          }
          out.close();
          in.close();
      }
  }
  </code></pre>
  
  <p>But I have no idea how to use lzma compression.</p>
  
  <p>I found this project: <a href="https://github.com/jponge/lzma-java">https://github.com/jponge/lzma-java</a> which creating compressed file but I don't know how I should combine it with my existing solution.</p>