#NEWLINE# def encodeValue( self , encodeFun , value , defMode , maxChunkSize ) : #NEWLINE# #INDENT# value . setDefaultComponents ( ) #NEWLINE# value . verifySizeSpec ( ) #NEWLINE# substrate = null #NEWLINE# idx = len ( value ) #NEWLINE# while ( idx > 0 ) : #NEWLINE# #INDENT# idx = ( idx - 1 ) #NEWLINE# if ( value [ idx ] is None ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# component = value . getDefaultComponentByPosition ( idx ) #NEWLINE# if ( ( encodeFun is not None ) and ( component == value [ idx ] ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# substrate = ( encodeFun ( value [ idx ] , defMode , maxChunkSize ) + substrate ) #NEWLINE# #UNINDENT# return ( substrate , 1 )