You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Kartik S (Jira)" <ji...@apache.org> on 2021/02/03 00:17:00 UTC
[jira] [Updated] (AVRO-3034) [avro-cpp] avro::ostreamOutputStream
doesn't flush the ofstream object
[ https://issues.apache.org/jira/browse/AVRO-3034?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kartik S updated AVRO-3034:
---------------------------
Summary: [avro-cpp] avro::ostreamOutputStream doesn't flush the ofstream object (was: [avro-cpp] avro::ostreamOutputStream doesn't flush the ostream object)
> [avro-cpp] avro::ostreamOutputStream doesn't flush the ofstream object
> ----------------------------------------------------------------------
>
> Key: AVRO-3034
> URL: https://issues.apache.org/jira/browse/AVRO-3034
> Project: Apache Avro
> Issue Type: Bug
> Reporter: Kartik S
> Priority: Major
>
> {code:java}
> auto avro_os = ::avro::ostreamOutputStream(*os);
> ::avro::EncoderPtr encoder = ::avro::binaryEncoder();
> encoder->init(*avro_os);
> ....{code}
> {code:java}
> encoder->flush();{code}
> When the above code is compiled with clang-10.0.0 (c++), ostreamOutputStream doesn't flush the ostream object (os) when encoder->flush() is invoked. To get around this I had to explicitly invoke the destructor using a block:
> {code:java}
> {
> std::ofstream out(filename);
> ....
> }{code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)