In a heavy saucepan or kettle, dissolve the sugar in the milk and bring just to a boil.
With a whip, beat the egg yolks and whole eggs in a stainless-steel bowl.
Sift the cornstarch and sugar into the eggs. Beat with the whip until perfectly smooth.
Temper the egg mixture by slowly beating in the hot milk in a thin stream.
Return the mixture to the heat and bring to a boil, stirring constantly.
When the mixture comes to a boil and thickens, remove from the heat.
Stir in the butter and vanilla. Mix until the butter is melted and completely blended in.
Pour out into a clean, sanitized hotel pan or other shallow pan. Cover with plastic film placed directly in contact with the surface of the cream to prevent a crust from forming. Cool and chill as quickly as possible.
For filling pastries such as éclairs and napoleons, whip the chilled pastry cream until smooth before using.