[ 
https://issues.apache.org/jira/browse/AVRO-3034?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kartik S updated AVRO-3034:
---------------------------
    Description: 
{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 ofstream 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}

  was:
{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}


> [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 ofstream 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)

Reply via email to