Background
Building following class
public class DerivedClass<T> extends BaseClass<T> {
@Override
public void invoke(T value, Context context) throws Exception {
//Send data to Kafka
// Need to covert to byte[]
}
}
Problem
Not sure if this makes sense, but need to convert this value to byte array
e.g. In case of String, it is possible using getBytes()
method. How to achieve this ?