Class UCharacterNameReader
java.lang.Object
com.ibm.icu.impl.UCharacterNameReader
- All Implemented Interfaces:
ICUBinary.Authenticate
Internal reader class for ICU data file uname.dat containing Unicode codepoint name data.
This class simply reads unames.icu, authenticates that it is a valid ICU data file and split its contents up into blocks of data for use in com.ibm.icu.impl.UCharacterName.
unames.icu which is in big-endian format is jared together with this package.
- Since:
- release 2.1, February 1st 2002
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intSize of an algorithmic name information group start code point size + end code point size + type size + variant size + size of data sizeprivate static final intFile format id that this class understands.private static final intSize of the group information block in number of charprivate intprivate ByteBufferByte buffer for namesprivate intprivate intprivate intIndex of the offset information -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedUCharacterNameReader(ByteBuffer bytes) Protected constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanauthenticate(byte[] dataformatid, byte[] dataformatversion) CLOVER:OFFbooleanisDataVersionAcceptable(byte[] version) Method used in ICUBinary.readHeader() to provide data format authentication.protected voidread(UCharacterName data) Read and break up the stream of data passed in as arguments and fills up UCharacterName.private UCharacterName.AlgorithmNamereadAlg()Reads an individual record of AlgorithmNames
-
Field Details
-
m_byteBuffer_
Byte buffer for names -
GROUP_INFO_SIZE_
private static final int GROUP_INFO_SIZE_Size of the group information block in number of char- See Also:
-
m_tokenstringindex_
private int m_tokenstringindex_Index of the offset information -
m_groupindex_
private int m_groupindex_ -
m_groupstringindex_
private int m_groupstringindex_ -
m_algnamesindex_
private int m_algnamesindex_ -
ALG_INFO_SIZE_
private static final int ALG_INFO_SIZE_Size of an algorithmic name information group start code point size + end code point size + type size + variant size + size of data size- See Also:
-
DATA_FORMAT_ID_
private static final int DATA_FORMAT_ID_File format id that this class understands.- See Also:
-
-
Constructor Details
-
UCharacterNameReader
Protected constructor.
- Parameters:
bytes- ICU uprop.dat file buffer- Throws:
IOException- throw if data file fails authentication
-
-
Method Details
-
isDataVersionAcceptable
public boolean isDataVersionAcceptable(byte[] version) Description copied from interface:ICUBinary.AuthenticateMethod used in ICUBinary.readHeader() to provide data format authentication.- Specified by:
isDataVersionAcceptablein interfaceICUBinary.Authenticate- Parameters:
version- version of the current data- Returns:
- true if dataformat is an acceptable version, false otherwise
-
read
Read and break up the stream of data passed in as arguments and fills up UCharacterName. If unsuccessful false will be returned.- Parameters:
data- instance of datablock- Throws:
IOException- thrown when there's a data error.
-
authenticate
protected boolean authenticate(byte[] dataformatid, byte[] dataformatversion) CLOVER:OFF -
readAlg
Reads an individual record of AlgorithmNames- Returns:
- an instance of AlgorithNames if read is successful otherwise null
- Throws:
IOException- thrown when file read error occurs or data is corrupted
-