Package org.exoplatform.commons.utils
Class CharsetCharEncoder
java.lang.Object
org.exoplatform.commons.utils.CharsetCharEncoder
- All Implemented Interfaces:
CharEncoder
An implementation of a char encoder that is stateless and is based on a specified charset.
- Version:
- $Revision$
- Author:
- Julien Viet
-
Constructor Summary
Constructors -
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.static CharEncodergetUTF8()
-
Constructor Details
-
CharsetCharEncoder
-
-
Method Details
-
getUTF8
-
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
-