public void stop() {
        if (this.cPointer == 0) {
            throw new ClosedException();
        }
        final int r = ppaml_phase_stop(this.cPointer);
        switch (r) {
        case 0:
            break;
        case 1:
            throw new ClockAcquisitionException();
        case 2:
            throw new OTFWriterExitException();
        default:
            throw new UnexpectedReturnValueError(r);
        }
    }