Class CMapStrings
java.lang.Object
org.apache.fontbox.cmap.CMapStrings
Many CMaps are using the same values for the mapped strings. This class provides all common one- and two-byte
mappings to avoid duplicate strings.
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]getByteValue(byte[] bytes) Get a singleton instance of the given combination of bytes to avoid multiple instances for same value.static IntegergetIndexValue(byte[] bytes) Get an Integer instance of the given combination of bytes.static StringgetMapping(byte[] bytes) Get the mapped string value for the given combination of bytes.
-
Method Details
-
getMapping
Get the mapped string value for the given combination of bytes. The mapping is limited to one and two-byte mappings. Any longer byte sequence produces null as return value.- Parameters:
bytes- the given combination of bytes- Returns:
- the string representation for the given combination of bytes
-
getIndexValue
Get an Integer instance of the given combination of bytes. Each value is a singleton to avoid multiple instances for same value. The values are limited to one and two-byte sequences. Any longer byte sequence produces null as return value.- Parameters:
bytes- the given combination of bytes- Returns:
- the Integer representation for the given combination of bytes
-
getByteValue
public static byte[] getByteValue(byte[] bytes) Get a singleton instance of the given combination of bytes to avoid multiple instances for same value. The values are limited to one and two-byte sequences. Any longer byte sequence produces null as return value.- Parameters:
bytes- the given combination of bytes- Returns:
- a singleton instance for the given combination of bytes
-