Cramfull Compiled Resources v2.00

be.arci.cramfull
Class Encoder

java.lang.Object
  |
  +--be.arci.cramfull.Encoder
Direct Known Subclasses:
ASCIIEncoder, CharEncoder, TwoByteEncoder

public abstract class Encoder
extends java.lang.Object

Encodes resources into an internal form that can be handled by the ClassCompiler. First the method String getDecoderClassName() is invoked on the implementing subclass, then the method void encode(DataInput di, int iResourceLength).

IMPORTANT: Subclasses should be public and either have no constructor declaration or have a public constructor that takes no arguments. Example implementations are given in the package be.arci.pub.

See Also:
getDecoderClassName(),
encode(DataInput di, int iResourceLength)

Constructor Summary
Encoder()
           
 
Method Summary
abstract  void 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.
abstract  java.lang.String getDecoderClassName()
          Returns the qualified java class name (no .class suffix), which is associated with the resource's internal form.
protected  void write(char c)
          Appends an encoded char to the resource's internal form.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Encoder

public Encoder()
Method Detail

write

protected final void write(char c)
Appends an encoded char to the resource's internal form.

Parameters:
c - the encoded char to write to the resource's internal form.

getDecoderClassName

public abstract java.lang.String getDecoderClassName()
Returns the qualified java class name (no .class suffix), which is associated with the resource's internal form.
Returns:
the qualified java class name (no .class suffix), which is associated with the resource's internal form.

encode

public abstract void encode(java.io.DataInput di,
                            int iResourceLength)
                     throws java.io.IOException
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.

Parameters:
di - a DataInput opened on the resource to encode.
iResourceLength - the number of bytes in the di that must be read and encoded.
See Also:
Decoder,
write(char c)

Cramfull Compiled Resources v2.00