On Numerical Boundary Treatment of Hyperbolic Systems for Finite Difference and Finite Element Methods