Package org.exoplatform.commons.utils
Class TableCharEncoder
java.lang.Object
org.exoplatform.commons.utils.TableCharEncoder
- All Implemented Interfaces:
CharEncoder
A char encoder that use a table to cache the result produced by a delegate char encoder. This encoder is stateless and should
only be composed with stateless char encoder otherwise an unexpected result may happen.
- Version:
- $Revision$
- Author:
- Julien Viet
-
Constructor Summary
ConstructorsConstructorDescriptionTableCharEncoder(CharEncoder charEncoder) Creates a new table based char encoder. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]encode(char c) Encodes a single char into an array of bytes.Returns the charset that will perform the encoding.
-
Constructor Details
-
TableCharEncoder
Creates a new table based char encoder.- Parameters:
charEncoder- the delegate char encoder
-
-
Method Details
-
getCharset
Description copied from interface:CharEncoderReturns the charset that will perform the encoding.- Specified by:
getCharsetin interfaceCharEncoder- Returns:
- the charset for encoding
-
encode
public byte[] encode(char c) Description copied from interface:CharEncoderEncodes a single char into an array of bytes. The returned array of bytes should not be modified.- Specified by:
encodein interfaceCharEncoder- Parameters:
c- the char to encode- Returns:
- the serie of bytes corresponding to the encoded char
-