summaryrefslogtreecommitdiff
path: root/src/encoder
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-12-16 10:24:43 +0100
committerMax Kellermann <max@duempel.org>2015-12-16 10:24:43 +0100
commite4a06da14e1184eacd00834aaf05c5457703a7eb (patch)
tree7d4d168bfd8475e9113b2d9d2e4b8b74c606f092 /src/encoder
parent36d6ead65cf507948744ee5d8615c8ef20e42f9d (diff)
fs/io/OutputStream: use C++ exceptions in Write()
Diffstat (limited to 'src/encoder')
-rw-r--r--src/encoder/ToOutputStream.cxx9
-rw-r--r--src/encoder/ToOutputStream.hxx5
2 files changed, 6 insertions, 8 deletions
diff --git a/src/encoder/ToOutputStream.cxx b/src/encoder/ToOutputStream.cxx
index 43345cf70..0d2cfc96c 100644
--- a/src/encoder/ToOutputStream.cxx
+++ b/src/encoder/ToOutputStream.cxx
@@ -22,8 +22,8 @@
#include "EncoderInterface.hxx"
#include "fs/io/OutputStream.hxx"
-bool
-EncoderToOutputStream(OutputStream &os, Encoder &encoder, Error &error)
+void
+EncoderToOutputStream(OutputStream &os, Encoder &encoder)
{
while (true) {
/* read from the encoder */
@@ -31,11 +31,10 @@ EncoderToOutputStream(OutputStream &os, Encoder &encoder, Error &error)
char buffer[32768];
size_t nbytes = encoder_read(&encoder, buffer, sizeof(buffer));
if (nbytes == 0)
- return true;
+ return;
/* write everything to the stream */
- if (!os.Write(buffer, nbytes, error))
- return false;
+ os.Write(buffer, nbytes);
}
}
diff --git a/src/encoder/ToOutputStream.hxx b/src/encoder/ToOutputStream.hxx
index e3fb7b908..d87295d89 100644
--- a/src/encoder/ToOutputStream.hxx
+++ b/src/encoder/ToOutputStream.hxx
@@ -24,9 +24,8 @@
struct Encoder;
class OutputStream;
-class Error;
-bool
-EncoderToOutputStream(OutputStream &os, Encoder &encoder, Error &error);
+void
+EncoderToOutputStream(OutputStream &os, Encoder &encoder);
#endif