avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Milind Vaidya <kava...@gmail.com>
Subject Failed Serializing Bytes
Date Tue, 09 Apr 2013 14:12:04 GMT
//Data to be written
                unsigned char buffer_data[] = {0x12, 0x34, 0x56,
0x78,0x12,0x34,0x56,0x78,0x12, 0x34, 0x56, 0x78,0x12, 0x34, 0x56,
0x78,0x12,0x34,0x56,0x78,0x12, 0x34, 0x56, 0x78,0x12, 0x34, 0x56,
0x78,0x12,0x34,0x56,0x78,0x12, 0x34, 0x56, 0x78};

                //Serialize bytes
                avro_value_t value;
                avro_file_writer_t writer;
                avro_schema_t byteSchema = avro_schema_bytes();


               avro_value_set_bytes(&value, buffer_data,
sizeof(buffer_data));
                avro_file_writer_create("./resource/Data.ser", byteSchema,
&writer);
                avro_file_writer_append_value(writer, &value);
                avro_file_writer_flush(writer);
                avro_file_writer_close(writer);

is this correct way to serialize bytes ? If yes not working for me :(

Mime
View raw message