protected void read ( UCharacterName data ) throws IOException { // reading index m_tokenstringindex_ = m_byteBuffer_ . getInt ( ) ; m_groupindex_ = m_byteBuffer_ . getInt ( ) ; m_groupstringindex_ = m_byteBuffer_ . getInt ( ) ; m_algnamesindex_ = m_byteBuffer_ . getInt ( ) ; // reading tokens int count = m_byteBuffer_ . getChar ( ) ; char token [ ] = ICUBinary . getChars ( m_byteBuffer_ , count , 0 ) ; int size = m_groupindex_ - m_tokenstringindex_ ; byte tokenstr [ ] = new byte [ size ] ; m_byteBuffer_ . get ( tokenstr ) ; data . setToken ( token , tokenstr ) ; // reading the group information records count = m_byteBuffer_ . getChar ( ) ; data . setGroupCountSize ( count , GROUP_INFO_SIZE_ ) ; count *= GROUP_INFO_SIZE_ ; char group [ ] = ICUBinary . getChars ( m_byteBuffer_ , count , 0 ) ; size = m_algnamesindex_ - m_groupstringindex_ ; byte groupstring [ ] = new byte [ size ] ; m_byteBuffer_ . get ( groupstring ) ; data . setGroup ( group , groupstring ) ; count = m_byteBuffer_ . getInt ( ) ; UCharacterName . AlgorithmName alg [ ] = new UCharacterName . AlgorithmName [ count ] ; for ( int i = 0 ; i < count ; i ++ ) { UCharacterName . AlgorithmName an = readAlg ( ) ; if ( an == null ) { throw new IOException ( "unames.icu read error: Algorithmic names creation error" ) ; } alg [ i ] = an ; } data . setAlgorithm ( alg ) ; }
Read and break up the stream of data passed in as arguments and fills up UCharacterName . If unsuccessful false will be returned .