String Compression
Page 1 of 1
String Compression
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
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
- Number of posts : 82
Warning :
Reputation :
Registration date : 2010-05-11
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum