mercredi 25 février 2015

Avro how to convert bytes to String in GenericRecord


GenericRecord record = getGenericRecord();
ByteBuffer buffer = (ByteBuffer) record.get(key);
String newString = new String(buffer.array(), Charset.forName("ASCII"));


I have this code to convert bytes field in GenericRecord to String but I ended up getting a dummy string. What do I miss?


Aucun commentaire:

Enregistrer un commentaire