@Override
    public void updateLast(Object morphedMessage, Object lastMessage)
    {
        final int last = references.size() - 1;
        if (lastMessage != null && lastMessage == references.get(last))
        {
            // update the reference
            references.set(last, morphedMessage);
        }
    }
A ByteArrayInput w/c can handle cyclic dependencies when deserializing objects with graph transformations.

@author David Yu
@created Dec 10, 2010
protostuff-core/src/main/java/io/protostuff/GraphByteArrayInput.java