Trimming Bouncy Castle Down to Size

Team-Fly

With both of the examples in this chapter, we're only using a small subset of the Bouncy Castle cryptography package. Since we have the whole source code available, we can take out pieces of the package we don't need in order to save space in the MIDlet suite JAR.

By simply removing whole directories of classes I didn't need, I was able to trim the size of the MIDlet suite for PasswordMIDlet and StealthMIDlet from 280KB to 114KB. Further trimming is also possible; I just chopped off the large pieces-directories like org/bouncycastle/asn1 and org/bouncycastle/crypto/test. If you remove individual classes and interfaces, further size reductions are possible.

Note 

If you try this technique in J2MEWTK, make sure you also remove the classes and tmpclasses directories in your project directory. Even though you remove a source file, the compiled class file may still be present in classes or tmpclasses. Removing these directories forces J2MEWTK to recompile everything.


Team-Fly


Wireless Java. Developing with J2ME
ColdFusion MX Professional Projects
ISBN: 1590590775
EAN: 2147483647
Year: 2000
Pages: 129

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net