# Class CharsetCache

java.lang.Object
org.apache.tomcat.util.buf.CharsetCache

public class CharsetCache extends Object
Cache for Charset instances.

## Constructor Summary

Constructors
Constructor
Description
`CharsetCache()`
Creates a new CharsetCache and pre-populates it with the initial charsets.

## Method Summary

Modifier and Type
Method
Description
`Charset`
`getCharset(String charsetName)`
Retrieves the charset for the given name.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### CharsetCache

public CharsetCache()
Creates a new CharsetCache and pre-populates it with the initial charsets.

## Method Details

### getCharset

public Charset getCharset(String charsetName)
Retrieves the charset for the given name.

Parameters:
  `charsetName` - the name of the charset
Returns:
  the charset, or `null` if not available