To protect the parties involved at a trial arising from a complaint or indictment for incest or rape, the trial judge may exclude all spectators from the courtroom in which such trial is being held, or from said courtroom during those portions of such trial when direct testimony is to be presented; provided, that either of the parties requests that all spectators be so excluded at the trial or portions thereof; and provided further, that the defendant in such trial by a written statement waives his right to a public trial for those portions from which spectators are so excluded.
Mass. Gen. Laws ch. 278, § 16C