Name

CharsetProvider

Synopsis

System programmers developing new Charset implementations should implement this class to make those charsets available to the system. charsetForName( ) should return a Charset instance for the given name. charsets( ) should return a java.util.Iterator that allows the caller to iterate through the set of Charset objects defined by the provider.

A CharsetProvider and its associated Charset implementations should be packaged in a JAR file and made available to the system in the jre/lib/ext/ extensions directory (or some other extensions location.) The JAR file should contain a file named META-INF/services/java.nio.charset.spi.CharsetProvider which contains the class name of the CharsetProvider implementation.

public abstract class CharsetProvider {
// Protected Constructors
     protected CharsetProvider( );  
// Public Instance Methods
     public abstract java.nio.charset.Charset charsetForName(String charsetName);
     public abstract java.util.Iterator<java.nio.charset.Charset> charsets( );  
}

Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.