Package com.ibm.icu.impl
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 int
Size of an algorithmic name information group start code point size + end code point size + type size + variant size + size of data sizeprivate static final int
File format id that this class understands.private static final int
Size of the group information block in number of charprivate int
private ByteBuffer
Byte buffer for namesprivate int
private int
private int
Index of the offset information -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
UCharacterNameReader
(ByteBuffer bytes) Protected constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
authenticate
(byte[] dataformatid, byte[] dataformatversion) Checking the file for the correct format.boolean
isDataVersionAcceptable
(byte[] version) Method used in ICUBinary.readHeader() to provide data format authentication.protected void
read
(UCharacterName data) Read and break up the stream of data passed in as arguments and fills up UCharacterName.private UCharacterName.AlgorithmName
readAlg()
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.Authenticate
Method used in ICUBinary.readHeader() to provide data format authentication.- Specified by:
isDataVersionAcceptable
in 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) Checking the file for the correct format.
- Parameters:
dataformatid
-dataformatversion
-- Returns:
- true if the file format version is correct
-
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
-