A wavelength-preserving photonic integrated regenerator for NRZ and RZ signals