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