Cramfull Compiled Resources v2.00

be.arci.pub
Class TwoByteDecoder

java.lang.Object
  |
  +--be.arci.cramfull.Decoder
        |
        +--be.arci.pub.TwoByteDecoder

public class TwoByteDecoder
extends Decoder

Example Decoder implementation for resources encoded by the TwoByteEncoder implementation of Encoder. Decodes each char as its high and low order byte.

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.

Since:
05/nov/2000
See Also:
TwoByteEncoder,
Decoder

Constructor Summary
TwoByteDecoder()
           
 
Method Summary
 byte[] decode(int iEncodedLength)
          Decodes a resource from a sequence of char-s.
 
Methods inherited from class be.arci.cramfull.Decoder
read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TwoByteDecoder

public TwoByteDecoder()
Method Detail

decode

public byte[] decode(int iEncodedLength)
Description copied from class: Decoder
Decodes a resource from a sequence of char-s. This is the reverse process of the corresponding Encoder's void encode(DataInput di, int iResourceLength). Implementations must invoke the method int read() to retrieve the encoded char-s of the resource.

Overrides:
decode in class Decoder
Tags copied from class: Decoder
Parameters:
iEncodedLength - the length in char-s of the encoded form of the resource
Returns:
the bytes of the decoded resource, as they were read in by the ClassCompiler from the original resource file. If a decoding error occurs, the implementing subclass has the choice of either returning the value null, or throwing a ResourceDecodingException giving more detailed info on the decoding error.
Throws:
ResourceDecodingException - if a decoding error occurs and the implementing subclass wants to give a more detailed message about the decoding error.
See Also:
Encoder.encode(DataInput di, int iResourceLength),
read()

Cramfull Compiled Resources v2.00