Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Avro >> mail # user >> Failed Serializing Bytes


Copy link to this message
-
Failed Serializing Bytes
//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 :(
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB