Top Description Fields Constructors Methods
com.ibm.icu.impl

public final Class ICUData

extends Object
Class Inheritance
Imports
java.io.IOException, .InputStream, java.net.URL, java.security.AccessController, .PrivilegedAction, java.util.MissingResourceException, java.util.logging.Logger, com.ibm.icu.util.VersionInfo

Provides access to ICU data files as InputStreams. Implements security checking.

Field Summary

Modifier and TypeField and Description
public static final String
ICU_BASE_NAME

The base name of ICU data to be used with ClassLoader.getResourceAsStream(), ICUResourceBundle.getBundleInstance() etc.

public static final String
ICU_BRKITR_BASE_NAME

The base name of rbbi data to be used with getBundleInstance API

public static final String
ICU_BRKITR_NAME

The base name of rbbi data to be used with getData API

public static final String
ICU_BUNDLE

The data path to be used with Class.getResourceAsStream().

public static final String
ICU_COLLATION_BASE_NAME

The base name of collation data to be used with getBundleInstance API

public static final String
pack-priv static final String
ICU_DATA_PATH

The data path to be used with getBundleInstance API

public static final String
public static final String
ICU_RBNF_BASE_NAME

The base name of rbnf data to be used with getBundleInstance API

public static final String
public static final String
ICU_TRANSLIT_BASE_NAME

The base name of transliterator data to be used with getBundleInstance API

public static final String
public static final String
private static final boolean
logBinaryDataFromInputStream

For testing (otherwise false): When reading an InputStream from a Class or ClassLoader (that is, not from a file), log when the stream contains ICU binary data.

private static final Logger
pack-priv static final String
PACKAGE_NAME

The ICU data package name.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static void
public static boolean
exists(final String resourceName)

public static InputStream
getRequiredStream(ClassLoader loader, String resourceName)

public static InputStream
getRequiredStream(String resourceName)

Convenience method that calls getStream(ICUData.class, resourceName, true).

public static InputStream
getRequiredStream(Class<?> root, String resourceName)

Convenience method that calls getStream(root, resourceName, true).

private static InputStream
getStream(final Class<?> root, final String resourceName, boolean required)

pack-priv static InputStream
getStream(final ClassLoader loader, final String resourceName, boolean required)

Should be called only from ICUBinary.getData() or from convenience overloads here.

public static InputStream
getStream(ClassLoader loader, String resourceName)

public static InputStream
getStream(String resourceName)

Convenience override that calls getStream(ICUData.class, resourceName, false); Returns null if the resource could not be found.

public static InputStream
getStream(Class<?> root, String resourceName)

Convenience override that calls getStream(root, resourceName, false); Returns null if the resource could not be found.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ICU_BASE_NAMEback to summary
public static final String ICU_BASE_NAME

The base name of ICU data to be used with ClassLoader.getResourceAsStream(), ICUResourceBundle.getBundleInstance() etc.

ICU_BRKITR_BASE_NAMEback to summary
public static final String ICU_BRKITR_BASE_NAME

The base name of rbbi data to be used with getBundleInstance API

ICU_BRKITR_NAMEback to summary
public static final String ICU_BRKITR_NAME

The base name of rbbi data to be used with getData API

ICU_BUNDLEback to summary
public static final String ICU_BUNDLE

The data path to be used with Class.getResourceAsStream().

ICU_COLLATION_BASE_NAMEback to summary
public static final String ICU_COLLATION_BASE_NAME

The base name of collation data to be used with getBundleInstance API

ICU_CURR_BASE_NAMEback to summary
public static final String ICU_CURR_BASE_NAME
ICU_DATA_PATHback to summary
pack-priv static final String ICU_DATA_PATH

The data path to be used with getBundleInstance API

ICU_LANG_BASE_NAMEback to summary
public static final String ICU_LANG_BASE_NAME
ICU_RBNF_BASE_NAMEback to summary
public static final String ICU_RBNF_BASE_NAME

The base name of rbnf data to be used with getBundleInstance API

ICU_REGION_BASE_NAMEback to summary
public static final String ICU_REGION_BASE_NAME
ICU_TRANSLIT_BASE_NAMEback to summary
public static final String ICU_TRANSLIT_BASE_NAME

The base name of transliterator data to be used with getBundleInstance API

ICU_UNIT_BASE_NAMEback to summary
public static final String ICU_UNIT_BASE_NAME
ICU_ZONE_BASE_NAMEback to summary
public static final String ICU_ZONE_BASE_NAME
logBinaryDataFromInputStreamback to summary
private static final boolean logBinaryDataFromInputStream

For testing (otherwise false): When reading an InputStream from a Class or ClassLoader (that is, not from a file), log when the stream contains ICU binary data. This cannot be ICUConfig'ured because ICUConfig calls ICUData.getStream() to read the properties file, so we would get a circular dependency in the class initialization.

loggerback to summary
private static final Logger logger
PACKAGE_NAMEback to summary
pack-priv static final String PACKAGE_NAME

The ICU data package name. This is normally the name of the .dat package, and the prefix (plus '/') of the package entry names.

Constructor Detail

ICUDataback to summary
public ICUData()

Method Detail

checkStreamForBinaryDataback to summary
private static void checkStreamForBinaryData(InputStream is, String resourceName)
Annotations
@SuppressWarnings:unused
existsback to summary
public static boolean exists(final String resourceName)
getRequiredStreamback to summary
public static InputStream getRequiredStream(ClassLoader loader, String resourceName)
getRequiredStreamback to summary
public static InputStream getRequiredStream(String resourceName)

Convenience method that calls getStream(ICUData.class, resourceName, true).

Exceptions
MissingResourceException:
if the resource could not be found
getRequiredStreamback to summary
public static InputStream getRequiredStream(Class<?> root, String resourceName)

Convenience method that calls getStream(root, resourceName, true).

Exceptions
MissingResourceException:
if the resource could not be found
getStreamback to summary
private static InputStream getStream(final Class<?> root, final String resourceName, boolean required)
getStreamback to summary
pack-priv static InputStream getStream(final ClassLoader loader, final String resourceName, boolean required)

Should be called only from ICUBinary.getData() or from convenience overloads here.

getStreamback to summary
public static InputStream getStream(ClassLoader loader, String resourceName)
getStreamback to summary
public static InputStream getStream(String resourceName)

Convenience override that calls getStream(ICUData.class, resourceName, false); Returns null if the resource could not be found.

getStreamback to summary
public static InputStream getStream(Class<?> root, String resourceName)

Convenience override that calls getStream(root, resourceName, false); Returns null if the resource could not be found.