Hi Howard,
Thank you for contacting us.
> I'm trying to pack a class whose hierarchy contains an abstract class.
> Specifically, I am trying to pack an instance of
> cern.colt.matrix.impl.RCDoubleMatrix2D
> (
http://acs.lbl.gov/software/colt/api/cern/colt/matrix/impl/RCDoubleMatrix2D.html).
> But I am getting the following exception:
>
> org.msgpack.MessageTypeException: org.msgpack.template.builder.TemplateBuildException: Cannot build template for abstract class: cern.colt.matrix.DoubleMatrix2D
As you know, current version of msgpack-java cannot build (generate)
templates for abstract classes. The limitation is the specification
that I defined because 'read' method in template class for abstract
class shouldn't be called. But your application (template generation
of third-party's abstract class) is usual. I think that next version
of msgpack-java should provide new API for the solution.
> Very straightforward method to pack DoubleMatrix2D class is to extract
> double[][] by using DoubleMatrix2D#getQuick() method.
> I don't confirm double[][] can be serialized directly, but double[][] can
> be serialized as array of double. Is it suitable for your use case?
like this:
double[][] src = ... your double[][] object...;
Packer packer = msgpack.createPacker(...);
packer.write(src);
...
Unpacker u = msgpack.createUnpacker(in);
double[][] dst = u.read(double[][].class);
Thanks,
Muga