org.entityfs.support.nio
Class Charsets

java.lang.Object
  extended by org.entityfs.support.nio.Charsets

public final class Charsets
extends Object

This class contains static utility methods for working with Charset:s.

Since:
1.1
Author:
Karl Gustafsson

Field Summary
static Charset UTF8
          The UTF-8 charset.
 
Method Summary
static byte[] encode(CharSequence s, Charset cs)
          Encode the supplied text in the specified charset.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UTF8

public static final Charset UTF8
The UTF-8 charset.

Method Detail

encode

public static byte[] encode(CharSequence s,
                            Charset cs)
                     throws FileSystemException
Encode the supplied text in the specified charset.

Parameters:
s - The text.
cs - The charset.
Returns:
A byte array containing the encoded string.
Throws:
FileSystemException - On character encoding errors.