class PdfEncodings {
/** Adds an extra encoding.
* @param name the name of the encoding. The encoding recognition is case insensitive
* @param enc the conversion class
*/
@SuppressWarnings("unchecked")
public static void addExtraEncoding(String name, ExtraEncoding enc) {
synchronized (extraEncodings) { // This serializes concurrent updates
HashMap<String, ExtraEncoding> newEncodings = (HashMap<String, ExtraEncoding>)extraEncodings.clone();
newEncodings.put(name.toLowerCase(), enc);
extraEncodings = newEncodings; // This swap does not require synchronization with reader
}
}
}