Package org.exoplatform.commons.utils
Class Text
java.lang.Object
org.exoplatform.commons.utils.Text
Represents text that can have several internal representations in order to minimize serialization when it is possible. The
bytes returned by the byte oriented method must returned the data encoded with the UTF-8 encoding.
- Version:
- $Revision$
- Author:
- Julien Viet
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Text
public Text()
-
-
Method Details
-
create
Create a text object from the provided byte array.- Parameters:
bytes- the markup as bytescharset- the charset- Returns:
- the text object
- Throws:
IllegalArgumentException- if the bytes is null
-
create
Create a text object from the provided char array.- Parameters:
chars- the markup as bytes- Returns:
- the text object
- Throws:
IllegalArgumentException- if the chars is null
-
create
Create a text object from the provided char array.- Parameters:
s- the markup as bytes- Returns:
- the text object
- Throws:
IllegalArgumentException- if the string is null
-
writeTo
- Throws:
IOException
-