This work deals with the rearrangement invariant Banach function space X and Banach Hardy classes generated by this space, which consist of analytic functions inside and outside the unit circle. In these Hardy classes we consider homogeneous and nonhomogeneous Riemann problems with piecewise continuous coefficient. We define new characteristic of the space X related to the power functions in X. Canonical solution is defined depending on the jumps of the argument of the coefficient of the problem. In terms of the above characteristic, we find a condition on the jumps of the argument depending on the Boyd indices of space X, which is sufficient for the solvability of these problems, and, in case of solvability, we construct a general solution. We also give an orthogonality condition for the solvability of nonhomogeneous problem. As X, considering specific spaces, we obtain previously known results