ObjectOutput globalOO = globalMarshal.startObjectOutput(baos, false, 1024);
try {
globalOO.writeObject(address);
/** BEGIN: Special treatment **/
globalOO.flush(); // IMPORTANT: Flush needed to make sure the address gets written!!
globalOO.writeInt(baos.size()); // Note amount of bytes that have been read so far
globalOO.flush(); // IMPORTANT: Flush again!
/** END: Special treatment **/
// Now try cache marshaller to 'borrow' the output stream
StreamingMarshaller cacheMarshaller = extractCacheMarshaller(cm.getCache());