Partager via


How to pack and unpack an array object holding other objects

If you want to pack an array with values of the types class, the classes held by the array must also be able to be packed.

Therefore the class that's in the array must implement SysPackable and you must implement the pack and unpack methods.
I presume you are familiar with these methods.

Furthermore the class must have a static method called create. For example:

 static public MyValueClass create(Container _packedClass)
{        
    MyValueClass  myValueClass;        
    ;         
    myValueClass = new MyValueClass();
    myValueClass.unpack(_container);
    return myValueClass;
}

 

This posting is provided "AS IS" with no warranties, and confers no rights.