  We investigate a scheme of atomic quantum memory to store photonic qubits of
polarization in cavity QED. It is observed that the quantum-state swapping
between a single-photon pulse and a $ \Lambda $-type atom can be made via
scattering in an optical cavity [T. W. Chen, C. K. Law, P. T. Leung, Phys. Rev.
A {\bf 69} (2004) 063810]. This swapping operates limitedly in the strong
coupling regime for $ \Lambda $-type atoms with equal dipole couplings. We
extend this scheme in cavity QED to present a more feasible and efficient
method for quantum memory combined with projective measurement. This method
works without requiring such a condition on the dipole couplings. The fidelity
is significantly higher than that of the swapping, and even in the moderate
coupling regime it reaches almost unity by narrowing sufficiently the
photon-pulse spectrum. This high performance is rather unaffected by the atomic
loss, cavity leakage or detunings, while a trade-off is paid in the success
probability for projective measurement.
