1 | Class ArrayOutputStream extends ObjectOutputStream { |
2 | Vector dataVector ; |
3 | public Object replaceObject(Object obj) { |
4 | if obj is a primitive array, then |
5 | if obj is (eg) an int[], then |
6 | int len = ((int []) obj).length ; |
7 | dataVector.addElement(new ArrayInfo(INT, len, obj)) ; |
8 | return new ArrayProxy(INT, len) ; |
9 | etc (deal with other primitive types). |
10 | else, if not a primitive array, then |
11 | return obj ; |
12 | } |
13 | } |