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

pack-priv final Class UCharacterNameReader

extends Object
implements Authenticate
Class Inheritance
All Implemented Interfaces
com.ibm.icu.impl.ICUBinary.Authenticate
Imports
java.io.IOException, java.nio.ByteBuffer, java.util.Arrays

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.

Author
Syn Wee Quek
Since
release 2.1, February 1st 2002

Field Summary

Modifier and TypeField and Description
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

private static final int
DATA_FORMAT_ID_

File format id that this class understands.

private static final int
GROUP_INFO_SIZE_

Size of the group information block in number of char

private int
private ByteBuffer
m_byteBuffer_

Byte buffer for names

private int
private int
private int
m_tokenstringindex_

Index of the offset information

Constructor Summary

AccessConstructor and Description
protected
UCharacterNameReader(ByteBuffer
ICU uprop.dat file buffer
bytes
)

Protected constructor.

Method Summary

Modifier and TypeMethod and Description
protected boolean

Returns:

true if the file format version is correct
authenticate
(byte[] dataformatid, byte[] dataformatversion)

Checking the file for the correct format.

public boolean
isDataVersionAcceptable(byte[]
version of the current data
version
)

Implements com.ibm.icu.impl.ICUBinary.Authenticate.isDataVersionAcceptable.

Method used in ICUBinary.readHeader() to provide data format authentication.
protected void
read(UCharacterName
instance of datablock
data
)

Read and break up the stream of data passed in as arguments and fills up UCharacterName.

private UCharacterName.AlgorithmName

Returns:

an instance of AlgorithNames if read is successful otherwise null
readAlg
()

Reads an individual record of AlgorithmNames

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ALG_INFO_SIZE_back to summary
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

DATA_FORMAT_ID_back to summary
private static final int DATA_FORMAT_ID_

File format id that this class understands.

GROUP_INFO_SIZE_back to summary
private static final int GROUP_INFO_SIZE_

Size of the group information block in number of char

m_algnamesindex_back to summary
private int m_algnamesindex_
m_byteBuffer_back to summary
private ByteBuffer m_byteBuffer_

Byte buffer for names

m_groupindex_back to summary
private int m_groupindex_
m_groupstringindex_back to summary
private int m_groupstringindex_
m_tokenstringindex_back to summary
private int m_tokenstringindex_

Index of the offset information

Constructor Detail

UCharacterNameReaderback to summary
protected UCharacterNameReader(ByteBuffer bytes) throws IOException

Protected constructor.

Parameters
bytes:ByteBuffer

ICU uprop.dat file buffer

Exceptions
IOException:
throw if data file fails authentication

Method Detail

authenticateback to summary
protected boolean authenticate(byte[] dataformatid, byte[] dataformatversion)

Checking the file for the correct format.

Returns:boolean

true if the file format version is correct

isDataVersionAcceptableback to summary
public boolean isDataVersionAcceptable(byte[] version)

Implements com.ibm.icu.impl.ICUBinary.Authenticate.isDataVersionAcceptable.

Doc from com.ibm.icu.impl.ICUBinary.Authenticate.isDataVersionAcceptable.

Method used in ICUBinary.readHeader() to provide data format authentication.

Parameters
version:byte[]

version of the current data

Returns:boolean

true if dataformat is an acceptable version, false otherwise

Annotations
@Override
readback to summary
protected void read(UCharacterName data) throws IOException

Read and break up the stream of data passed in as arguments and fills up UCharacterName. If unsuccessful false will be returned.

Parameters
data:UCharacterName

instance of datablock

Exceptions
IOException:
thrown when there's a data error.
readAlgback to summary
private UCharacterName.AlgorithmName readAlg() throws IOException

Reads an individual record of AlgorithmNames

Returns:UCharacterName.AlgorithmName

an instance of AlgorithNames if read is successful otherwise null

Exceptions
IOException:
thrown when file read error occurs or data is corrupted