com.caucho.vfs
Class Encoding

java.lang.Object
  |
  +--com.caucho.vfs.Encoding

public class Encoding
extends java.lang.Object

Converts between the mime encoding names and Java encoding names.


Method Summary
static java.lang.String getJavaName(java.util.Locale locale)
          Returns the Java name for the given locale.
static java.lang.String getJavaName(java.lang.String encoding)
          Returns the Java name for the given encoding.
static java.lang.String getMimeName(java.util.Locale locale)
          Returns the canonical mime name for the given locale.
static java.lang.String getMimeName(java.lang.String encoding)
          Returns the canonical mime name for the given character encoding.
static java.io.Reader getReadEncoding(java.io.InputStream is, java.lang.String encoding)
          Returns a Reader to translate bytes to characters.
static java.io.Writer getWriteEncoding(java.io.OutputStream os, java.lang.String encoding)
          Returns a Writer to translate characters to bytes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getMimeName

public static java.lang.String getMimeName(java.lang.String encoding)
Returns the canonical mime name for the given character encoding.
Parameters:
encoding - character encoding name, possibly an alias
Returns:
canonical mime name for the encoding.

getMimeName

public static java.lang.String getMimeName(java.util.Locale locale)
Returns the canonical mime name for the given locale.
Parameters:
locale - locale to use.
Returns:
canonical mime name for the encoding.

getReadEncoding

public static java.io.Reader getReadEncoding(java.io.InputStream is,
                                             java.lang.String encoding)
Returns a Reader to translate bytes to characters. If a specialized reader exists in com.caucho.vfs.i18n, use it.
Parameters:
is - the input stream.
encoding - the encoding name.
Returns:
a reader for the translation

getWriteEncoding

public static java.io.Writer getWriteEncoding(java.io.OutputStream os,
                                              java.lang.String encoding)
Returns a Writer to translate characters to bytes.
Parameters:
os - the output stream.
encoding - the encoding name.
Returns:
a writer for the translation

getJavaName

public static java.lang.String getJavaName(java.lang.String encoding)
Returns the Java name for the given encoding.
Parameters:
encoding - character encoding name
Returns:
Java encoding name

getJavaName

public static java.lang.String getJavaName(java.util.Locale locale)
Returns the Java name for the given locale.
Parameters:
locale - the locale to use
Returns:
Java encoding name