title: Java: Bzip2 library
body: <p>I need to create Bzip2 archive.
  A downloaded bzip2 library from 'Apache ant'.</p>
  
  <pre><code>I use class CBZip2OutputStream: 
  String s = .....
  CBZip2OutputStream os = new CBZip2OutputStream(fos);
                  os.write(s.getBytes(Charset.forName("UTF-8")));
                  os.flush();
                  os.close();
  </code></pre>
  
  <p>(I didn't find any example how to use it, so I decided to use it in this way)</p>
  
  <p>But it creates a corrupted archive on the disk. </p>