Central Games Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

String Compression

Go down

String Compression Empty String Compression

Post by bujjiammulu Sun May 16, 2010 10:04 am

import com.chilkatsoft.*;

public class ChilkatExample {

static {
try {
System.loadLibrary("chilkat");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load.\n" + e);
System.exit(1);
}
}

public static void main(String argv[])
{

// The Crypt component has the BZip2 compression
// and decompression features, combined with encoding/decoding,
// that is required for string-to-string compression.
CkCrypt2 crypt = new CkCrypt2();

// Any string argument automatically begins the 30-day trial.
boolean success;
success = crypt.UnlockComponent("30-day trial");
if (success != true) {
System.out.println("Crypt component unlock failed");
return;
}

String s;
s = "A friend called me up the other day and talked about investing in a dot-com";
s = s + " that sells lobsters. Internet lobsters. Where will this end? --Donald Trump";

// Make this string a bit bigger...
s = s + s;
s = s + s;
s = s + s;

crypt.put_CryptAlgorithm("none");
crypt.put_EncodingMode("base64");

String compressed;
compressed = crypt.compressStringENC(s);

System.out.println(compressed);

String decompressed;
decompressed = crypt.inflateStringENC(compressed);

System.out.println(decompressed);


}
}








Herpes Dating Service
Wedding Favor

bujjiammulu
Newbie
Newbie

Number of posts : 82
Warning :
String Compression Left_bar_bleue0 / 1000 / 100String Compression Right_bar_bleue

Reputation :
String Compression Left_bar_bleue0 / 1000 / 100String Compression Right_bar_bleue

Registration date : 2010-05-11

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum