Class LzmaUtils

java.lang.Object
com.github.tommyettinger.textra.utils.LzmaUtils

public final class LzmaUtils extends Object
Simple static utilities to make using the LZMA compression in libGDX easier. This simply handles opening and closing compressed and decompressed files without needing to catch IOException. If something goes wrong, this will throw an unchecked exception, a GdxRuntimeException, with more information than the original IOException would have.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    compress(com.badlogic.gdx.files.FileHandle input, com.badlogic.gdx.files.FileHandle output)
    Given an input FileHandle and an output FileHandle that will be overwritten, compresses input using Lzma and writes the result into output.
    static void
    decompress(com.badlogic.gdx.files.FileHandle input, com.badlogic.gdx.files.FileHandle output)
    Given an input FileHandle compressed with Lzma, and an output FileHandle that will be overwritten, decompresses input into output.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • decompress

      public static void decompress(com.badlogic.gdx.files.FileHandle input, com.badlogic.gdx.files.FileHandle output)
      Given an input FileHandle compressed with Lzma, and an output FileHandle that will be overwritten, decompresses input into output.
      Parameters:
      input - the Lzma-compressed FileHandle to read; typically the file extension ends in ".lzma"
      output - the FileHandle to write to; will be overwritten
    • compress

      public static void compress(com.badlogic.gdx.files.FileHandle input, com.badlogic.gdx.files.FileHandle output)
      Given an input FileHandle and an output FileHandle that will be overwritten, compresses input using Lzma and writes the result into output.
      Parameters:
      input - the FileHandle to read; will not be modified
      output - the FileHandle to write Lzma-compressed output to; typically the file extension ends in ".lzma"