Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
Avro, mail # user - Failed Serializing Bytes


Copy link to this message
-
Failed Serializing Bytes
Milind Vaidya 2013-04-09, 14:12
//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 :(
+
Douglas Creager 2013-04-11, 12:32
+
Milind Vaidya 2013-04-12, 04:01