A Characterization of Dirichlet-inner Functions