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


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 ;
}
}



© 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