lejos.charset
Class Latin1Encoder
java.lang.Object
lejos.charset.Latin1Encoder
- All Implemented Interfaces:
- CharsetEncoder
public class Latin1Encoder
- extends Object
- implements CharsetEncoder
Method Summary |
int |
encode(int codepoint,
byte[] target,
int offset)
Writes the encoding of the codepoint to the byte-array. |
int |
estimateByteCount(int codepoint)
Return the number of bytes needed to encode the given codepoint. |
int |
getMaxCharLength()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Latin1Encoder
public Latin1Encoder()
getMaxCharLength
public int getMaxCharLength()
- Specified by:
getMaxCharLength
in interface CharsetEncoder
encode
public int encode(int codepoint,
byte[] target,
int offset)
- Description copied from interface:
CharsetEncoder
- Writes the encoding of the codepoint to the byte-array.
The codepoint may be -1 to indicate an undecodable codepoint.
- Specified by:
encode
in interface CharsetEncoder
- Parameters:
codepoint
- the character to encodetarget
- target byte arrayoffset
- index of first byte
- Returns:
- the offset for the next character
estimateByteCount
public int estimateByteCount(int codepoint)
- Description copied from interface:
CharsetEncoder
- Return the number of bytes needed to encode the given codepoint.
The value returned must not be an underestimation.
- Specified by:
estimateByteCount
in interface CharsetEncoder
- Parameters:
codepoint
- the Unicode codepoint
- Returns:
- the estimated number of bytes