Method | Description | |
---|---|---|
Compress ( Stream instream, long inLength, Stream outstream, bool original ) : int |
Compresses the input using the 'original', unoptimized compression algorithm. This algorithm should yield files that are the same as those found in the games. (delegates to the optimized method if LookAhead is set)
|
|
Compress ( string infile, string outfile ) : int | ||
Decompress ( Stream instream, long inLength, Stream outstream ) : long |
Decompresses the given stream, writing the decompressed data to the given output stream. Assumes
|
|
Decompress ( string infile, string outfile ) : long |
Method | Description | |
---|---|---|
CompressWithLA ( Stream instream, long inLength, Stream outstream ) : int |
Variation of the original compression method, making use of Dynamic Programming to 'look ahead' and determine the optimal 'length' values for the compressed blocks. Is not 100% optimal, as the flag-bytes are not taken into account.
|
|
GetOptimalCompressionLengths ( byte indata, int inLength, int &lengths, int &disps ) : void |
Gets the optimal compression lengths for each start of a compressed block using Dynamic Programming. This takes O(n^2) time, although in practice it will often be O(n^3) since one of the constants is 0x10110 (the maximum length of a compressed block)
|
public static Compress ( Stream instream, long inLength, Stream outstream, bool original ) : int | ||
instream | Stream | |
inLength | long | |
outstream | Stream | |
original | bool | |
return | int |
public static Compress ( string infile, string outfile ) : int | ||
infile | string | |
outfile | string | |
return | int |
public static Decompress ( Stream instream, long inLength, Stream outstream ) : long | ||
instream | Stream | The stream to decompress. At the end of this method, the position /// of this stream is directly after the compressed data. |
inLength | long | The length of the input data. Not necessarily all of the /// input data may be read (if there is padding, for example), however never more than /// this number of bytes is read from the input stream. |
outstream | Stream | The stream to write the decompressed data to. |
return | long |
public static Decompress ( string infile, string outfile ) : long | ||
infile | string | |
outfile | string | |
return | long |