Two characterizations of pure injective modules