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
?
You can use its method toString()
toString in interface CharSequence
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With