| Modifier and Type | Class and Description |
|---|---|
| public static interface | ICUBinary.Authenticate
Special interface for data authentication |
| private abstract static class | |
| private static class | ICUBinary.DatPackageReader
Reads the ICU .dat package file format. |
| private static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final byte | CHAR_SET_
File format authentication values |
| private static final byte | |
| private static final String | |
| private static final List | |
| private static final byte | MAGIC1
Magic numbers to authenticate the data file |
| private static final byte | |
| private static final String | MAGIC_NUMBER_AUTHENTICATION_FAILED_
Error messages |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static void | addBaseNamesInFileFolder(String
The relative ICU data folder, like "" or "coll". folder, String Usually ".res". suffix, Set<String> File base names relative to the folder are added without the suffix,
for example "de_CH". names)
|
| private static void | |
| private static void | |
| pack-priv static int | compareKeys(CharSequence key, ByteBuffer bytes, int offset)
Compares the length-specified input key with the NUL-terminated table key. |
| pack-priv static int | |
| public static ByteBuffer | getByteBufferFromInputStreamAndCloseStream(InputStream is)
Reads the entire contents from the stream into a byte array and wraps it into a ByteBuffer. |
| public static byte[] | |
| public static char[] | |
| public static ByteBuffer | |
| public static ByteBuffer | Returns: The data as a read-only ByteBuffer, or null if the resource could not be found.Used for loader.getResourceAsStream() unless the data is found elsewhere. loader, String Resource name for use with the loader. resourceName, String Relative ICU data item path, for example "root.res" or "coll/ucadata.icu". itemPath)Loads an ICU binary data file and returns it as a ByteBuffer. |
| private static ByteBuffer | Returns: The data as a read-only ByteBuffer, or null if required==false and the resource could not be found.Used for loader.getResourceAsStream() unless the data is found elsewhere. loader, String Resource name for use with the loader. resourceName, String Relative ICU data item path, for example "root.res" or "coll/ucadata.icu". itemPath, boolean If the resource cannot be found,
this method returns null (!required) or throws an exception (required). required)Loads an ICU binary data file and returns it as a ByteBuffer. |
| private static ByteBuffer | |
| public static int[] | |
| public static long[] | |
| public static ByteBuffer | Returns: The data as a read-only ByteBuffer.Relative ICU data item path, for example "root.res" or "coll/ucadata.icu". itemPath)Loads an ICU binary data file and returns it as a ByteBuffer. |
| public static short[] | |
| public static String | |
| public static byte[] | getVersionByteArrayFromCompactInt(int version)
Returns an array of the bytes in the compact version integer. |
| public static VersionInfo | getVersionInfoFromCompactInt(int version)
Returns a VersionInfo for the bytes in the compact version integer. |
| private static ByteBuffer | |
| public static int | Returns: dataVersionReads an ICU data header, checks the data format, and returns the data version. |
| public static VersionInfo | readHeaderAndDataVersion(ByteBuffer bytes, int dataFormat, ICUBinary.
Same as readHeader(), but returns a VersionInfo rather than a compact int. |
| public static void | |
| public static ByteBuffer | |
| public static int | Returns: The length of the header (number of bytes written).Writes an ICU data header. |
| CHAR_SET_ | back to summary |
|---|---|
| private static final byte CHAR_SET_ File format authentication values | |
| CHAR_SIZE_ | back to summary |
|---|---|
| private static final byte CHAR_SIZE_ | |
| HEADER_AUTHENTICATION_FAILED_ | back to summary |
|---|---|
| private static final String HEADER_AUTHENTICATION_FAILED_ | |
| icuDataFiles | back to summary |
|---|---|
| private static final List<ICUBinary. | |
| MAGIC1 | back to summary |
|---|---|
| private static final byte MAGIC1 Magic numbers to authenticate the data file | |
| MAGIC2 | back to summary |
|---|---|
| private static final byte MAGIC2 | |
| MAGIC_NUMBER_AUTHENTICATION_FAILED_ | back to summary |
|---|---|
| private static final String MAGIC_NUMBER_AUTHENTICATION_FAILED_ Error messages | |
| ICUBinary | back to summary |
|---|---|
| public ICUBinary() | |
| addBaseNamesInFileFolder | back to summary |
|---|---|
| public static void addBaseNamesInFileFolder(String folder, String suffix, Set<String> names) | |
| addDataFilesFromFolder | back to summary |
|---|---|
| private static void addDataFilesFromFolder(File folder, StringBuilder itemPath, List<ICUBinary. | |
| addDataFilesFromPath | back to summary |
|---|---|
| private static void addDataFilesFromPath(String dataPath, List<ICUBinary. | |
| compareKeys | back to summary |
|---|---|
| pack-priv static int compareKeys(CharSequence key, ByteBuffer bytes, int offset) Compares the length-specified input key with the NUL-terminated table key. (ASCII) | |
| compareKeys | back to summary |
|---|---|
| pack-priv static int compareKeys(CharSequence key, byte[] bytes, int offset) | |
| getByteBufferFromInputStreamAndCloseStream | back to summary |
|---|---|
| public static ByteBuffer getByteBufferFromInputStreamAndCloseStream(InputStream is) throws IOException Reads the entire contents from the stream into a byte array and wraps it into a ByteBuffer. Closes the InputStream at the end. | |
| getBytes | back to summary |
|---|---|
| public static byte[] getBytes(ByteBuffer bytes, int length, int additionalSkipLength) | |
| getChars | back to summary |
|---|---|
| public static char[] getChars(ByteBuffer bytes, int length, int additionalSkipLength) | |
| getData | back to summary |
|---|---|
| public static ByteBuffer getData(String itemPath) Loads an ICU binary data file and returns it as a ByteBuffer. The buffer contents is normally read-only, but its position etc. can be modified.
| |
| getData | back to summary |
|---|---|
| public static ByteBuffer getData(ClassLoader loader, String resourceName, String itemPath) Loads an ICU binary data file and returns it as a ByteBuffer. The buffer contents is normally read-only, but its position etc. can be modified.
| |
| getData | back to summary |
|---|---|
| private static ByteBuffer getData(ClassLoader loader, String resourceName, String itemPath, boolean required) Loads an ICU binary data file and returns it as a ByteBuffer. The buffer contents is normally read-only, but its position etc. can be modified.
| |
| getDataFromFile | back to summary |
|---|---|
| private static ByteBuffer getDataFromFile(String itemPath) | |
| getInts | back to summary |
|---|---|
| public static int[] getInts(ByteBuffer bytes, int length, int additionalSkipLength) | |
| getLongs | back to summary |
|---|---|
| public static long[] getLongs(ByteBuffer bytes, int length, int additionalSkipLength) | |
| getRequiredData | back to summary |
|---|---|
| public static ByteBuffer getRequiredData(String itemPath) Loads an ICU binary data file and returns it as a ByteBuffer. The buffer contents is normally read-only, but its position etc. can be modified.
| |
| getShorts | back to summary |
|---|---|
| public static short[] getShorts(ByteBuffer bytes, int length, int additionalSkipLength) | |
| getString | back to summary |
|---|---|
| public static String getString(ByteBuffer bytes, int length, int additionalSkipLength) | |
| getVersionByteArrayFromCompactInt | back to summary |
|---|---|
| public static byte[] getVersionByteArrayFromCompactInt(int version) Returns an array of the bytes in the compact version integer. | |
| getVersionInfoFromCompactInt | back to summary |
|---|---|
| public static VersionInfo getVersionInfoFromCompactInt(int version) Returns a VersionInfo for the bytes in the compact version integer. | |
| mapFile | back to summary |
|---|---|
private static ByteBuffer mapFile(File path)
| |
| readHeader | back to summary |
|---|---|
| public static int readHeader(ByteBuffer bytes, int dataFormat, ICUBinary. Reads an ICU data header, checks the data format, and returns the data version. Assumes that the ByteBuffer position is 0 on input. The buffer byte order is set according to the data. The buffer position is advanced past the header (including UDataInfo and comment). See C++ ucmndata.h and unicode/udata.h.
| |
| readHeaderAndDataVersion | back to summary |
|---|---|
| public static VersionInfo readHeaderAndDataVersion(ByteBuffer bytes, int dataFormat, ICUBinary. Same as readHeader(), but returns a VersionInfo rather than a compact int. | |
| skipBytes | back to summary |
|---|---|
| public static void skipBytes(ByteBuffer bytes, int skipLength) | |
| sliceWithOrder | back to summary |
|---|---|
| public static ByteBuffer sliceWithOrder(ByteBuffer bytes) Same as ByteBuffer.slice() plus preserving the byte order. | |
| writeHeader | back to summary |
|---|---|
| public static int writeHeader(int dataFormat, int formatVersion, int dataVersion, DataOutputStream dos) throws IOException Writes an ICU data header. Does not write a copyright string.
| |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if dataformat is an acceptable version, false otherwiseversion of the current data version)Method used in ICUBinary.readHeader() to provide data format authentication. |
| isDataVersionAcceptable | back to summary |
|---|---|
| public boolean isDataVersionAcceptable(byte[] version) Method used in ICUBinary.readHeader() to provide data format authentication.
| |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv abstract void | addBaseNamesInFolder(String
The relative ICU data folder, like "" or "coll". folder, String Usually ".res". suffix, Set<String> File base names relative to the folder are added without the suffix,
for example "de_CH". names)
|
| pack-priv abstract ByteBuffer | |
| public String |
| itemPath | back to summary |
|---|---|
| protected final String itemPath | |
| DataFile | back to summary |
|---|---|
| pack-priv DataFile(String item) | |
| addBaseNamesInFolder | back to summary |
|---|---|
| pack-priv abstract void addBaseNamesInFolder(String folder, String suffix, Set<String> names) | |
| getData | back to summary |
|---|---|
| pack-priv abstract ByteBuffer getData(String requestedPath) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | DATA_FORMAT
.dat package data format ID "CmnD". |
| private static final ICUBinary. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static boolean | addBaseName(ByteBuffer bytes, int index, String folder, String suffix, StringBuilder sb, Set<String> names)
|
| pack-priv static void | |
| private static int | |
| pack-priv static ByteBuffer | |
| private static int | |
| private static int | |
| private static boolean | |
| pack-priv static boolean |
| DATA_FORMAT | back to summary |
|---|---|
| private static final int DATA_FORMAT .dat package data format ID "CmnD". | |
| IS_ACCEPTABLE | back to summary |
|---|---|
| private static final ICUBinary. | |
| DatPackageReader | back to summary |
|---|---|
| private DatPackageReader() | |
| addBaseName | back to summary |
|---|---|
| pack-priv static boolean addBaseName(ByteBuffer bytes, int index, String folder, String suffix, StringBuilder sb, Set<String> names) | |
| addBaseNamesInFolder | back to summary |
|---|---|
| pack-priv static void addBaseNamesInFolder(ByteBuffer bytes, String folder, String suffix, Set<String> names) | |
| binarySearch | back to summary |
|---|---|
| private static int binarySearch(ByteBuffer bytes, CharSequence key) | |
| getData | back to summary |
|---|---|
| pack-priv static ByteBuffer getData(ByteBuffer bytes, CharSequence key) | |
| getDataOffset | back to summary |
|---|---|
| private static int getDataOffset(ByteBuffer bytes, int index) | |
| getNameOffset | back to summary |
|---|---|
| private static int getNameOffset(ByteBuffer bytes, int index) | |
| startsWithPackageName | back to summary |
|---|---|
| private static boolean startsWithPackageName(ByteBuffer bytes, int start) | |
| validate | back to summary |
|---|---|
| pack-priv static boolean validate(ByteBuffer bytes) Checks that the ByteBuffer contains a valid, usable ICU .dat package. Moves the buffer position from 0 to after the data header. | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | isDataVersionAcceptable(byte[]
version of the current data version)Implements com. |
| IsAcceptable | back to summary |
|---|---|
| private IsAcceptable() | |
| isDataVersionAcceptable | back to summary |
|---|---|
| public boolean isDataVersionAcceptable(byte[] version) Implements com. Doc from com. Method used in ICUBinary.readHeader() to provide data format authentication.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final ByteBuffer | pkgBytes
.dat package bytes, or null if not a .dat package. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | addBaseNamesInFolder(String
The relative ICU data folder, like "" or "coll". folder, String Usually ".res". suffix, Set<String> File base names relative to the folder are added without the suffix,
for example "de_CH". names)Implements abstract com. |
| pack-priv ByteBuffer |
| pkgBytes | back to summary |
|---|---|
| private final ByteBuffer pkgBytes .dat package bytes, or null if not a .dat package. position() is after the header. Do not modify the position or other state, for thread safety. | |
| PackageDataFile | back to summary |
|---|---|
| pack-priv PackageDataFile(String item, ByteBuffer bytes) | |
| addBaseNamesInFolder | back to summary |
|---|---|
| pack-priv void addBaseNamesInFolder(String folder, String suffix, Set<String> names) Implements abstract com.
| |
| getData | back to summary |
|---|---|
| pack-priv ByteBuffer getData(String requestedPath) Implements abstract com.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final File |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | addBaseNamesInFolder(String
The relative ICU data folder, like "" or "coll". folder, String Usually ".res". suffix, Set<String> File base names relative to the folder are added without the suffix,
for example "de_CH". names)Implements abstract com. |
| pack-priv ByteBuffer | |
| public String | toString()
Overrides com. |
| path | back to summary |
|---|---|
| private final File path | |
| SingleDataFile | back to summary |
|---|---|
| pack-priv SingleDataFile(String item, File path) | |
| addBaseNamesInFolder | back to summary |
|---|---|
| pack-priv void addBaseNamesInFolder(String folder, String suffix, Set<String> names) Implements abstract com.
| |
| getData | back to summary |
|---|---|
| pack-priv ByteBuffer getData(String requestedPath) Implements abstract com.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides com. Doc from java. Returns a string representation of the object. | |