public static void unXZFile(File input, File output) {
FileInputStream fis = null;
FileOutputStream fos = null;
BufferedInputStream bis = null;
XZInputStream xzis = null;
try {
fis = new FileInputStream(input);
xzis = new XZInputStream(fis);
fos = new FileOutputStream(output);
final byte[] buffer = new byte[8192];
int n = 0;
while (-1 != (n = xzis.read(buffer))) {
fos.write(buffer, 0, n);
}
} catch (IOException e) {
App.settings.logStackTrace(e);
} finally {
try {
if (fis != null) {
fis.close();
}
if (bis != null) {
bis.close();
}
if (fos != null) {
fos.close();
}
if (xzis != null) {
xzis.close();
}
} catch (IOException e) {
App.settings.logStackTrace(e);
}
}