org.weborganic.berlioz.util
Class CharsetUtils

java.lang.Object
  extended by org.weborganic.berlioz.util.CharsetUtils

public final class CharsetUtils
extends Object

A bunch of utility functions for dealing with character sets.

Since:
Berlioz 0.8.1
Version:
Berlioz 0.8.1 - 24 June 2011
Author:
Christophe Lauret

Method Summary
static int length(CharSequence content, Charset charset)
          Calculates the byte length of the specified content using the given charset.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

length

public static int length(CharSequence content,
                         Charset charset)
Calculates the byte length of the specified content using the given charset.

Parameters:
content - The content to measure
charset - The character set
Returns:
the byte length of the content based on a specified charset; or -1 if unable to calculate it
Throws:
NullPointerException - if either argument is null.