uk.me.parabola.imgfmt.app.labelenc
Interface CharacterDecoder

All Known Implementing Classes:
AnyCharsetDecoder, Format6Decoder, Utf8Decoder

public interface CharacterDecoder

Interface for decoding characters for use in the Label section of a .img file. These things are stateful, you add bytes read from the file to them and they return a status when a complete label has been obtained. At this point you retrieve the text.

Author:
Steve Ratcliffe

Method Summary
 boolean addByte(int b)
          Add a byte to this decoder.
 DecodedText getText()
          Get the valid text.
 

Method Detail

addByte

boolean addByte(int b)
Add a byte to this decoder. This will be saved until a complete label string has been detected.

Parameters:
b - The byte read from the lbl file.
Returns:
True if a label string is finished and is ready to be retrieved via the getText() method.

getText

DecodedText getText()
Get the valid text. This is guaranteed to be encoded as utf-8.

Returns:
The byte array and length as an EncodedText struct.