MarshalledValueOutputStream out = new MarshalledValueOutputStream(baos);
out.writeShort(STATE_TRANSFER_VERSION);
// Write a placeholder for the 3 sizes we'll merge in later
out.writeInt(0);
out.writeInt(0);
out.writeInt(0);
out.close();
}
/**
* Do a preorder traversal: visit the node first, then the node's children