Skip to content

Instantly share code, notes, and snippets.

@alecmce
Created February 25, 2011 09:22
Show Gist options
  • Save alecmce/843564 to your computer and use it in GitHub Desktop.
Save alecmce/843564 to your computer and use it in GitHub Desktop.
LZMA class
/**
* consolidate the LZMA encoder and decoders from @joa and @inspirit
*/
package
{
import apparat.lzma.LZMADecoder;
import ru.inspirit.lzma.LZMAEncoder;
import flash.utils.ByteArray;
public class LZMA
{
private var encoder:LZMAEncoder;
private var decoder:LZMADecoder;
public function LZMA()
{
encoder = new LZMAEncoder();
decoder = new LZMADecoder();
}
public function encode(source:ByteArray, target:ByteArray):void
{
encoder.encode(source, target);
}
public function decode(source:ByteArray, target:ByteArray):void
{
decoder.code(source, target, target.length);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment