I write a sample with avro library. It generate java class source code User
from schema record User
.
I want to encode User
to byte[]
, and decode byte[]
to User
.
When decoding, I've got error message:
java.lang.ClassCastException: org.apache.avro.util.Utf8 cannot be cast to java.lang.String
How to convert org.apache.avro.util.Utf8
to java String
?
toGenericRecord()
method ? – Circinus