An embedding of compensated compound Poisson processes with applications to local times