OLD | NEW |
1 /* | 1 /* |
2 ******************************************************************************* | 2 ******************************************************************************* |
3 * Copyright (C) 1996-2014, International Business Machines Corporation and | 3 * Copyright (C) 1996-2014, International Business Machines Corporation and |
4 * others. All Rights Reserved. | 4 * others. All Rights Reserved. |
5 ******************************************************************************* | 5 ******************************************************************************* |
6 */ | 6 */ |
7 | 7 |
8 package com.ibm.icu.impl; | 8 package com.ibm.icu.impl; |
9 | 9 |
10 import java.io.IOException; | 10 import java.io.IOException; |
11 import java.io.InputStream; | |
12 import java.nio.ByteBuffer; | 11 import java.nio.ByteBuffer; |
13 import java.util.Iterator; | 12 import java.util.Iterator; |
14 import java.util.MissingResourceException; | 13 import java.util.MissingResourceException; |
15 | 14 |
16 import com.ibm.icu.lang.UCharacter; | 15 import com.ibm.icu.lang.UCharacter; |
17 import com.ibm.icu.lang.UCharacter.HangulSyllableType; | 16 import com.ibm.icu.lang.UCharacter.HangulSyllableType; |
18 import com.ibm.icu.lang.UCharacter.NumericType; | 17 import com.ibm.icu.lang.UCharacter.NumericType; |
19 import com.ibm.icu.lang.UCharacterCategory; | 18 import com.ibm.icu.lang.UCharacterCategory; |
20 import com.ibm.icu.lang.UProperty; | 19 import com.ibm.icu.lang.UProperty; |
21 import com.ibm.icu.lang.UScript; | 20 import com.ibm.icu.lang.UScript; |
(...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
963 /** | 962 /** |
964 * Script_Extensions data | 963 * Script_Extensions data |
965 */ | 964 */ |
966 public char[] m_scriptExtensions_; | 965 public char[] m_scriptExtensions_; |
967 | 966 |
968 // private variables ------------------------------------------------- | 967 // private variables ------------------------------------------------- |
969 | 968 |
970 /** | 969 /** |
971 * Default name of the datafile | 970 * Default name of the datafile |
972 */ | 971 */ |
973 private static final String DATA_FILE_NAME_ = ICUResourceBundle.ICU_BUNDLE+"
/uprops.icu"; | 972 private static final String DATA_FILE_NAME_ = "uprops.icu"; |
974 | 973 |
975 /** | 974 /** |
976 * Shift value for lead surrogate to form a supplementary character. | 975 * Shift value for lead surrogate to form a supplementary character. |
977 */ | 976 */ |
978 private static final int LEAD_SURROGATE_SHIFT_ = 10; | 977 private static final int LEAD_SURROGATE_SHIFT_ = 10; |
979 /** | 978 /** |
980 * Offset to add to combined surrogate pair to avoid masking. | 979 * Offset to add to combined surrogate pair to avoid masking. |
981 */ | 980 */ |
982 private static final int SURROGATE_OFFSET_ = | 981 private static final int SURROGATE_OFFSET_ = |
983 UTF16.SUPPLEMENTARY_MIN_VALUE - | 982 UTF16.SUPPLEMENTARY_MIN_VALUE - |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1177 { | 1176 { |
1178 // consistency check | 1177 // consistency check |
1179 if(binProps.length!=UProperty.BINARY_LIMIT) { | 1178 if(binProps.length!=UProperty.BINARY_LIMIT) { |
1180 throw new ICUException("binProps.length!=UProperty.BINARY_LIMIT"); | 1179 throw new ICUException("binProps.length!=UProperty.BINARY_LIMIT"); |
1181 } | 1180 } |
1182 if(intProps.length!=(UProperty.INT_LIMIT-UProperty.INT_START)) { | 1181 if(intProps.length!=(UProperty.INT_LIMIT-UProperty.INT_START)) { |
1183 throw new ICUException("intProps.length!=(UProperty.INT_LIMIT-UPrope
rty.INT_START)"); | 1182 throw new ICUException("intProps.length!=(UProperty.INT_LIMIT-UPrope
rty.INT_START)"); |
1184 } | 1183 } |
1185 | 1184 |
1186 // jar access | 1185 // jar access |
1187 InputStream is = ICUData.getRequiredStream(DATA_FILE_NAME_); | 1186 ByteBuffer bytes=ICUBinary.getRequiredData(DATA_FILE_NAME_); |
1188 ByteBuffer bytes=ICUBinary.getByteBufferFromInputStream(is); | |
1189 m_unicodeVersion_ = ICUBinary.readHeaderAndDataVersion(bytes, DATA_FORMA
T, new IsAcceptable()); | 1187 m_unicodeVersion_ = ICUBinary.readHeaderAndDataVersion(bytes, DATA_FORMA
T, new IsAcceptable()); |
1190 // Read or skip the 16 indexes. | 1188 // Read or skip the 16 indexes. |
1191 int propertyOffset = bytes.getInt(); | 1189 int propertyOffset = bytes.getInt(); |
1192 /* exceptionOffset = */ bytes.getInt(); | 1190 /* exceptionOffset = */ bytes.getInt(); |
1193 /* caseOffset = */ bytes.getInt(); | 1191 /* caseOffset = */ bytes.getInt(); |
1194 int additionalOffset = bytes.getInt(); | 1192 int additionalOffset = bytes.getInt(); |
1195 int additionalVectorsOffset = bytes.getInt(); | 1193 int additionalVectorsOffset = bytes.getInt(); |
1196 m_additionalColumnsCount_ = bytes.getInt(); | 1194 m_additionalColumnsCount_ = bytes.getInt(); |
1197 int scriptExtensionsOffset = bytes.getInt(); | 1195 int scriptExtensionsOffset = bytes.getInt(); |
1198 int reservedOffset7 = bytes.getInt(); | 1196 int reservedOffset7 = bytes.getInt(); |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1508 */ | 1506 */ |
1509 /* | 1507 /* |
1510 public UnicodeSet getInclusions() { | 1508 public UnicodeSet getInclusions() { |
1511 UnicodeSet set = new UnicodeSet(); | 1509 UnicodeSet set = new UnicodeSet(); |
1512 NormalizerImpl.addPropertyStarts(set); | 1510 NormalizerImpl.addPropertyStarts(set); |
1513 addPropertyStarts(set); | 1511 addPropertyStarts(set); |
1514 return set; | 1512 return set; |
1515 } | 1513 } |
1516 */ | 1514 */ |
1517 } | 1515 } |
OLD | NEW |