Example Encoder implementation, that encodes 2 bytes as 1 char.
Encodes a Resource by reading it in as chars, at 2 bytes per char. The
evenness of the resource's file length in bytes is encoded in the first
char: even length is encoded as '2', uneven length as '1'. If that length
is uneven, the file's first byte is encoded alone in the loworder part of
the second char.
If you encode resorces using this class, you have to include the
TwoByteDecoder class in the distribution of your software.
We supply this class as a free service to all users of the
Cramfull Compiled Resources library.
You are allowed to modify this source code, provided you move the class out of
the be.arci package hierarchy.
encode(java.io.DataInput di,
int iResourceLength)
Encodes the resource file into a sequence of char-s; implementations must invoke
write(char c) for each encoded char.
java.lang.String
getDecoderClassName()
The Decoder associated with this Encoder
is be.arci.pub.TwoByteDecoder
Methods inherited from class be.arci.cramfull.Encoder
Encodes the resource file into a sequence of char-s; implementations must invoke
write(char c) for each encoded char. The Decoder
will read this char sequence in the same order.