Basic HTML version of Foils prepared July 6 99

Foil 33 Customized output stream class

From Object serialization for Marshalling Data in a Java Interface to MPI ACM Java Grande Meeting -- June 12-13 99. by Bryan Carpenter,Geoffrey C. Fox, Sung-Hoon Ko, Sang Lim


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 }

in Table To:


© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Tue Jul 6 1999