Hi netcdf-java developers,
I recently had the requirement of serializing/deserializing a
ucar.ma2.Array instance for local client-side caching
and was wondering why the current implementation (4.2.32) does not
implement java.io.Serializable or java.io.Externalizable?
Are there any particular reasons for this, or am I overlooking something?
In order to check whether any severe problems would wait down the road,
I created a delegate for ucar.ma2.Array and wrote an associated unit
test, showing that it is possible to successfully serialize and
deserialize arbitrary arrays. I would however prefer to be able to
extend ucar.ma2.Array directly, which is currently not possible
unless I create the new class within the ucar.ma2 namespace. This is due
to three methods in
ucar.ma2.Array that are using default visibility (abstract Array
createView(Index index), abstract void copyFrom1DJavaArray(IndexIterator
iter, Object javaArray),
and abstract void copyTo1DJavaArray(IndexIterator iter, Object
javaArray)). Their visibility effectively disallows extension
of ucar.ma2.Array from outside the ucar.ma2 package.
Would it be possible to set the visibility of these methods to public in
the netcdf-java api without other negative side effects or would anyone
propose a different approach?
Maybe someone else has experience with Array serialization and would be
interested in sharing or providing me some further pointers?
I would greatly appreciate any help on this.
Nils Hoffmann phone: +49-521-106-4342
Bielefeld University room: U10-144
Faculty of Technology, Genome Informatics
P.O. Box 10 01 31
33501 Bielefeld, Germany