diff --git a/include/DoocsSpectrum.h b/include/DoocsSpectrum.h
index b7685107a932e7b6da907c0f340024c0d823a8aa..bb88c630467bbc19f9077bc8c4cfd98b9662e280 100644
--- a/include/DoocsSpectrum.h
+++ b/include/DoocsSpectrum.h
@@ -73,7 +73,7 @@ namespace ChimeraTK {
 
     void setMacroPulseNumberSource(boost::shared_ptr<ChimeraTK::NDRegisterAccessor<int64_t>> macroPulseNumberSource);
 
-    void write(std::fstream& fptr) override;
+    void write(std::ostream& s) override;
 
     boost::shared_ptr<ChimeraTK::NDRegisterAccessor<float>> _processArray;
     boost::shared_ptr<ChimeraTK::NDRegisterAccessor<float>> _startAccessor;
diff --git a/src/DoocsSpectrum.cc b/src/DoocsSpectrum.cc
index 46fd5bbbdf750530f90835ae15eb10e9421c92db..8776ee9ae3e734abfb0d7b1e8a3593be9bbfd913 100644
--- a/src/DoocsSpectrum.cc
+++ b/src/DoocsSpectrum.cc
@@ -80,7 +80,7 @@ namespace ChimeraTK {
     }
   }
 
-  void DoocsSpectrum::write(std::fstream& fptr) {
+  void DoocsSpectrum::write(std::ostream& s) {
     // DOOCS is normally keeping the location lock until everything is written for that location: all D_spectrum and all
     // other properties. This can take too long (like seconds), which leads to noticable freezes of the UI. As a
     // work-around we release the lock here, wait some time and acquire the lock again. Since this happens in a separate
@@ -89,7 +89,7 @@ namespace ChimeraTK {
     usleep(1000);
     efp_->lock();
     if(!modified) return;
-    D_spectrum::write(fptr);
+    D_spectrum::write(s);
   }
 
   void DoocsSpectrum::updateDoocsBuffer(TransferElementID transferElementId) {