private RemoteMethodReturnMessage readMethodReturn(ByteBuffer buffer) throws IOException{
        RemoteMethodReturnMessage ret = new RemoteMethodReturnMessage();
        ret.invocationID = buffer.getShort();
        if (buffer.get() == (byte)0x01){
            ret.retVal = Serializer.readClassAndObject(buffer);
        }
        return ret;
    }
{@link RmiSerializer} is responsible for serializing RMI messages
like define object, call, and return.

@author Kirill Vainer
jme3-networking/src/main/java/com/jme3/network/rmi/RmiSerializer.java