public void setUnionBytes(Integer ndx, byte[] bytes)
throws Exception {
int oldLength = getSerializedLength();
if (value != null)
value.setContainerJid(null);
ActorFactory factory = getUnionFactories()[ndx];
factoryIndex = ndx;
value = (Jid) factory.newActor(getMailbox(), getParent());
value.setContainerJid(this);
value.load(new ReadableBytes(bytes, 0));
change(getSerializedLength() - oldLength);
}