private String readString(ByteBuffer buffer){
        int length = buffer.get() & 0xff;
        for (int i = 0; i < length; i++){
            chrBuf[i] = (char) (buffer.get() & 0xff);
        }
        return String.valueOf(chrBuf, 0, length);
    }
{@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