Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

gnu.java.nio.charset
Class EncodingHelper  view EncodingHelper download EncodingHelper.java

java.lang.Object
  extended bygnu.java.nio.charset.EncodingHelper

public class EncodingHelper
extends java.lang.Object

This class provides some useful utility methods for charset encoding for the java.lang and java.io methods.


Field Summary
private static java.util.HashMap canonicalNames
          Contains the mapping from java.io canonical names to java.nio canonical names.
 
Constructor Summary
EncodingHelper()
           
 
Method Summary
static java.nio.charset.Charset getCharset(java.lang.String name)
          Gets a charset, throwing the java.io exception and not the java.nio exception if an error occurs.
static java.lang.String getDefaultEncoding()
          Returns the name of the default encoding, falls back on defaults to Latin-1 if there's a problem.
static java.lang.String getOldCanonical(java.lang.String newCanonical)
          Returns the java.io canonical name of a charset given with the java.nio canonical name.
static boolean isISOLatin1(java.lang.String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

canonicalNames

private static java.util.HashMap canonicalNames
Contains the mapping from java.io canonical names to java.nio canonical names.

Constructor Detail

EncodingHelper

public EncodingHelper()
Method Detail

getDefaultEncoding

public static java.lang.String getDefaultEncoding()
Returns the name of the default encoding, falls back on defaults to Latin-1 if there's a problem.


getOldCanonical

public static java.lang.String getOldCanonical(java.lang.String newCanonical)
Returns the java.io canonical name of a charset given with the java.nio canonical name. If the charset does not have a java.io canonical name, the input string is returned.


isISOLatin1

public static boolean isISOLatin1(java.lang.String s)

getCharset

public static java.nio.charset.Charset getCharset(java.lang.String name)
                                           throws java.io.UnsupportedEncodingException
Gets a charset, throwing the java.io exception and not the java.nio exception if an error occurs.