Opinion by
Hirt, J.,
In the Court of Oyer and Terminer of Allegheny County relator was convicted of rape and robbery. He was sentenced on this conviction to a term of imprisonment in the Western State Penitentiary of from seven and one-half to fifteen years, effective as of March 7, 1949. While serving this sentence he was convicted in the quarter sessions on a charge of riot at No. 554 May Sessions, 1953 and was sentenced to imprisonment in the Western State Penitentiary for a term of one and one-half to three years, to take effect upon the expiration of the minimum term of the prior sentence for rape and robbery.
On relator’s present petition for a writ of habeas corpus, his claim was that his conviction and sentence for prison riot were unlawful, and he prayed for his discharge from imprisonment on that ground. In the meantime he had been transferred to the State Penitentiary at Graterford. A rule was granted on relator’s petition returnable August 31, 1955. The Attorney General of the Commonwealth moved to dismiss the petition on the ground that it did not state a cause of action and therefore was not self sustaining; the District Attorney of Allegheny County joined in the motion. After hearing before the iower court on September- 22, 1955 the rule was discharged and' the court by order dated April ‘26, 1956 dismissed relator’s petition thereby denying relief on' habeas corpus. The present appea.1 is from that order.
The appeal raises three main issues.
*6461. It is a complete answer, to the attack upon the order, that when relator petitioned for the writ he was serving the admittedly valid sentence for rape and robbery. The minimum term of that sentence had not expired and he had not yet begun to serve the sentence imposed for riot. The petition therefore was premature and well might have been dismissed without prejudice, for that reason alone. Com. ex rel. Lewis v. Ashe, Warden, 335 Pa. 575, 7 A. 2d 296; Com. ex rel. Toliver v. Ashe, Warden, 336 Pa. 206, 8 A. 2d 541. An application for a writ of habeas corpus is premature if made before the expiration of an admittedly valid minimum sentence. Com. ex rel. Sloan v. Ashe, Warden, 133 Pa. Superior Ct. 32, 1 A. 2d 788. The order of the court however does not rest on that ground alone. The transcript of what occurred at the hearing covers 85 typewritten pages and demonstrates that Judge Alpern, before whom the hearing was had, with tolerance and much patience explored every phase of the application on the merits and found no issues of fact requiring an award of the writ and the taking of testimony.
2. Relator in his petition alleges that the prison authorities denied him the opportunity to appeal his conviction of riot. The denial of the right of appeal by one convicted of crime constitutes a violation of the equal protection clause of the Fourteenth Amendment, Dowd v. United States ex rel. Cook, 340 U. S. 206, 71 S. Ct. 262. Here however, before the lower court at the hearing, it was clearly indicated that relator’s rights were not invaded. On the contrary from the admissions of appellant’s counsel, however evasively and reluctantly madé, it affirmatively appeared that relator was not in any way prevented from taking an appeal. The riot at the Western Penitentiary oc*647curred in January 1953 and relator was indicted in the quarter sessions for participating in that prison riot. While this indictment was pending relator filed a petition for a writ of habeas corpus at 905 October Term, 1953. The petition for the writ in that case averred that appellant had been denied the opportunity to prepare an adequate defense to the riot charge. In denying the petition Judge Ellenbogen instructed appellant that the time to raise that question was at the trial of the riot charge. Appellant’s present counsel took an appeal to this court from the dismissal of that petition and this same counsel discontinued the appeal on the approach of the time fixed for argument before us. The defendants on the riot charge were tried before Judge Kennedy. At the trial appellant raised the question of the adequacy of the opportunity afforded him to prepare his defense. Judge Kennedy after argument ruled that he had not been hindered in that respect and appellant’s motion for a continuance on that ground was denied. Although appellant’s present counsel did not actively represent him at the trial (the court of its own motion appointed a member of the bar to defend him) it is clear from the record before us that Hymen Schlesinger was appellant’s counsel without interruption from the date of the riot charge down to the present. And he stated at the oral argument in the lower court, that he had told Thompson that the proper time to take an appeal would be after his conviction for riot. No appeal was taken from that conviction although Thompson was represented by counsel throughout the appeal period. This habeas corpus proceeding cannot be used as a substitute for an appeal in that case. Com. ex rel. Capone v. Smith, Warden, 298 Pa. 318, 148 A. 307. There is no allegation that relator was denied the right to the *648prompt mailing of Ms letters either before or after his transfer to Graterford. Mr. Schlessinger admitted the receipt of a letter from relator written after the time for appeal had expired (which was the first received from him). In the present proceeding for his discharge on habeas corpus relator again alleged practically all that had been charged in his prior petition which had been dismissed by Judge Ellenbogen. By relator’s failure to prosecute his appeal from that order of dismissal we may take as adjudicated in this proceeding all of the complaints alleged in that petition.
3. Appellant in his present petition averred that he was the victim of cruel and unusual punishment in the penitentiary following his conviction of riot. In Sweeney v. Woodall, 344 U. S. 86, 73 S. Ct. 139, the United States Supreme Court held that one who relied for relief because of cruel and unusual punishment would be required to exhaust all available remedies in his state courts before making any application to the federal courts. Within limitations, cruel and inhuman punishment may be grounds for discharge on habeas corpus. In this State the Department of Justice has the power and the obligation “to supervise and control” our State penitentiaries. The Act of April 9, 1929, P. L. 177 with its additions, also provides for a Bureau of Correction in the Department of Justice, 71 PS §301 et seq. And by §2318 of the same Act, as amended, 71 PS §608, it is provided that there shall be a Board of Trustees for each prison charged with “general direction and control of the property and management . . .” of the prison. The board has control over prison discipline and the conditions under which prisoners live. By executive order of the Governor (according to the statement of a Deputy Attorney General to the court below) the powers of the *649Board of Trustees are now vested in the Bureau of Correction. The relator in the present proceeding at no time complained to the Bureau or to the Trustees, of mistreatment in the penitentiary. The lower court under the circumstances found the case of Ex Parte Perry, 47 Okla. Crim. Reports 156, 287 Pac. 755, persuasive. In Oklahoma there was a statute which set up administrative machinery to deal with prisoners’ complaints. In that case the prisoner as here, charged that he ivas the victim of cruel and inhuman punishment. The holding of the court was that a writ of habeas corpus, on that ground, would not issue where the petitioner had not exhausted the administrative remedies provided for him by law. That view, we have no doubt, is also the law of Pennsylvania. In passing, it may be noted that Judge Alpern was not deaf to these charges but was convinced that there was no real merit in them.
Order affirmed.