Hello,
I'm trying to encode avro::GenericDatum to JSON using this code:
    avro::EncoderPtr d = avro::jsonEncoder(validSchema);
    std::unique_ptr<avro::OutputStream> out = avro::memoryOutputStream();
    d->init(*out);
    avro::encode(*d, datum);
    out->flush();
    std::unique_ptr<avro::InputStream> in = avro::memoryInputStream(*out);
    avro::StreamReader r(*in);
    size_t bc = out->byteCount();
    uint8_t* jsonBytes = new uint8_t[bc];
    r.readBytes(jsonBytes,bc);
But size of jsonBytes somehow appears to be equal 4096 and the value is padded with symbol 'H' after JSON and most annoying thing is that resulting JSON lacks last curly bracket, like this - "timestamp":1366150681НННННННННННННН...
What am I missing here?

Reply via email to