diff Core/Compression/ZipWriter.cpp @ 3945:0b3256c3ee14 transcoding

simplified IDicomTranscoder
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 19 May 2020 11:24:00 +0200
parents 94f4a18a79cc
children
line wrap: on
line diff
--- a/Core/Compression/ZipWriter.cpp	Tue May 19 10:17:06 2020 +0200
+++ b/Core/Compression/ZipWriter.cpp	Tue May 19 11:24:00 2020 +0200
@@ -227,7 +227,7 @@
   }
 
 
-  void ZipWriter::Write(const char* data, size_t length)
+  void ZipWriter::Write(const void* data, size_t length)
   {
     if (!hasFileInZip_)
     {
@@ -236,17 +236,19 @@
 
     const size_t maxBytesInAStep = std::numeric_limits<int32_t>::max();
 
+    const char* p = reinterpret_cast<const char*>(data);
+    
     while (length > 0)
     {
       int bytes = static_cast<int32_t>(length <= maxBytesInAStep ? length : maxBytesInAStep);
 
-      if (zipWriteInFileInZip(pimpl_->file_, data, bytes))
+      if (zipWriteInFileInZip(pimpl_->file_, p, bytes))
       {
         throw OrthancException(ErrorCode_CannotWriteFile,
                                "Cannot write data to ZIP archive: " + path_);
       }
       
-      data += bytes;
+      p += bytes;
       length -= bytes;
     }
   }