aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/message.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/message.cc')
-rw-r--r--src/google/protobuf/message.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/google/protobuf/message.cc b/src/google/protobuf/message.cc
index a0d3feba..7fda0c79 100644
--- a/src/google/protobuf/message.cc
+++ b/src/google/protobuf/message.cc
@@ -38,20 +38,22 @@
#include <google/protobuf/message.h>
+#include <google/protobuf/stubs/casts.h>
#include <google/protobuf/stubs/logging.h>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/mutex.h>
#include <google/protobuf/stubs/once.h>
+#include <google/protobuf/descriptor.pb.h>
#include <google/protobuf/reflection_internal.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/io/zero_copy_stream_impl.h>
-#include <google/protobuf/descriptor.pb.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/map_field.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
#include <google/protobuf/stubs/strutil.h>
+
#include <google/protobuf/stubs/map_util.h>
#include <google/protobuf/stubs/singleton.h>
#include <google/protobuf/stubs/stl_util.h>
@@ -170,12 +172,12 @@ size_t Message::SpaceUsedLong() const {
bool Message::SerializeToFileDescriptor(int file_descriptor) const {
io::FileOutputStream output(file_descriptor);
- return SerializeToZeroCopyStream(&output);
+ return SerializeToZeroCopyStream(&output) && output.Flush();
}
bool Message::SerializePartialToFileDescriptor(int file_descriptor) const {
io::FileOutputStream output(file_descriptor);
- return SerializePartialToZeroCopyStream(&output);
+ return SerializePartialToZeroCopyStream(&output) && output.Flush();
}
bool Message::SerializeToOstream(std::ostream* output) const {
@@ -270,7 +272,7 @@ class GeneratedMessageFactory : public MessageFactory {
void RegisterType(const Descriptor* descriptor, const Message* prototype);
// implements MessageFactory ---------------------------------------
- const Message* GetPrototype(const Descriptor* type);
+ const Message* GetPrototype(const Descriptor* type) override;
private:
// Only written at static init time, so does not require locking.