public BufferSizePredictor getBufferSizePredictor ( Class < ? > type ) { MarshallingType marshallingType = typeHints . get ( type ) ; if ( marshallingType == null ) { // Initialise with isMarshallable to null, meaning it's unknown marshallingType = new MarshallingType ( null , new AdaptiveBufferSizePredictor ( ) ) ; MarshallingType prev = typeHints . putIfAbsent ( type , marshallingType ) ; if ( prev != null ) { marshallingType = prev ; } else { if ( trace ) { log . tracef ( "Cache a buffer size predictor for '%s' assuming " + "its serializability is unknown" , type . getName ( ) ) ; } } } return marshallingType . sizePredictor ; }
Get the serialized form size predictor for a particular type .