org.gjt.pp.app2class
Downloads Source Javadoc
Author: Unspecified
Home Page:
Version: Unspecified
Release Tag: Unknown
Release Date: Unknown
JVM Required: Unspecified
License: Unspecified
Categories: None
Requirements:
Dependencies: No dependencies
Externals: None

This package can generate a single Java class from a set of classes and resources and thus is suitable for creating self-extracting installers etc.

The package contains the following classes:
App2Class - this is an executable class which generates a single .class file from the given list of files. See the example.sh script.
DecoderStream - this class is packed in the generated one and used for decoding other stored data.
AppLoader - the class that contains code for loading and running the encoded application. It is used to construct the output.

The generated code works as follows: When App2Class generates the output class, it loads AppLoader.class file, renames the class to the required name, and adds static final String constants to it. For each resource added, field with name dataN, and fields with names dataN_n are inserted. dataN holds the resource's name (N is its number) and dataN_n stores its data. Each String has a limited length, so there may be multiple String for one resource.

When the generated class is instantiated, it examines itself using Reflection for the fields mentioned above. Then, it uses them to load all other data.

Because String constants are stored in UTF format, it is efficient to use only characters in the range \u0001 to \u007f. So each resource is first Deflated and then encoded to contain only characters 0x00 to 0x7f (the 0x00 character is stored in two bytes). This is why the DecodingStream class is needed.


Downloads

The following page lists the available downloads for the release of package 'org.gjt.pp.app2class' tagged 'Unknown'. If you need to work with releases other than 'Unknown', you will need to use the anonymous CVS server to access them.