Class ArrayOutputStream extends ObjectOutputStream { |
Vector dataVector ; |
public Object replaceObject(Object obj) { |
if obj is a primitive array, then |
if obj is (eg) an int[], then |
int len = ((int []) obj).length ; |
dataVector.addElement(new ArrayInfo(INT, len, obj)) ; |
return new ArrayProxy(INT, len) ; |
etc (deal with other primitive types). |
else, if not a primitive array, then |
return obj ; |
} |
} |