static void deserialize ( DataInput in , Serializers serializers ) throws IOException , ClassNotFoundException { int size = in . readInt ( ) ; if ( size > 0 ) { StringBuilder msg = new StringBuilder ( String . format ( "Deserialize %d serializer classes:" , size ) ) ; if ( serializers . serializersArray . length < size ) { serializers . serializersArray = Arrays . copyOf ( serializers . serializersArray , size ) ; } int max = 0 ; for ( int i = 0 ; i < size ; i ++ ) { int index = in . readInt ( ) ; max = Math . max ( max , index ) ; String serializerClassName = in . readUTF ( ) ; try { Class < Serializer > serializerClass = ( Class < Serializer > ) Class . forName ( serializerClassName ) ; Serializer serializerInstance = serializerClass . newInstance ( ) ; serializers . serializers . put ( getSerializerType ( serializerInstance ) , new SerializerWrapper ( index , serializerInstance ) ) ; serializers . serializersArray [ index ] = serializerInstance ; msg . append ( String . format ( "%n (%d) %s" , index , serializerClassName ) ) ; } catch ( Exception ex ) { LOGGER . log ( Level . WARNING , ( String . format ( "Can't find the serializer '%s'" , serializerClassName ) ) , ex ) ; } } serializers . COUNTER . set ( max + 1 ) ; LOGGER . info ( msg . toString ( ) ) ; } }
Deserializes this class from a data input .