Dynamic allocat buffer by params.