private void writeObjectDef(ByteBuffer buffer, ObjectDef def) throws IOException{
        buffer.putShort((short)def.objectId);
        writeString(buffer, def.objectName);
        Method[] methods = def.methods;
        buffer.put( (byte) methods.length );
        for (Method method : methods){
            writeMethod(buffer, method);
        }
    }
{@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