public IntTrie serialize ( TrieBuilder . DataManipulate datamanipulate , Trie . DataManipulate triedatamanipulate ) { if ( datamanipulate == null ) { throw new IllegalArgumentException ( "Parameters can not be null" ) ; } // fold and compact if necessary, also checks that indexLength is // within limits if ( ! m_isCompacted_ ) { // compact once without overlap to improve folding compact ( false ) ; // fold the supplementary part of the index array fold ( datamanipulate ) ; // compact again with overlap for minimum data array length compact ( true ) ; m_isCompacted_ = true ; } // is dataLength within limits? if ( m_dataLength_ >= MAX_DATA_LENGTH_ ) { throw new ArrayIndexOutOfBoundsException ( "Data length too small" ) ; } char index [ ] = new char [ m_indexLength_ ] ; int data [ ] = new int [ m_dataLength_ ] ; // write the index (stage 1) array and the 32-bit data (stage 2) array // write 16-bit index values shifted right by INDEX_SHIFT_ for ( int i = 0 ; i < m_indexLength_ ; i ++ ) { index [ i ] = ( char ) ( m_index_ [ i ] >>> INDEX_SHIFT_ ) ; } // write 32-bit data values System . arraycopy ( m_data_ , 0 , data , 0 , m_dataLength_ ) ; int options = SHIFT_ | ( INDEX_SHIFT_ << OPTIONS_INDEX_SHIFT_ ) ; options |= OPTIONS_DATA_IS_32_BIT_ ; if ( m_isLatin1Linear_ ) { options |= OPTIONS_LATIN1_IS_LINEAR_ ; } return new IntTrie ( index , data , m_initialValue_ , options , triedatamanipulate ) ; }
Serializes the build table with 32 bit data