Created
February 25, 2011 09:22
-
-
Save alecmce/843564 to your computer and use it in GitHub Desktop.
LZMA class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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