private void writeMethod(ByteBuffer buffer, Method method) throws IOException{
        String     name = method.getName();
        Class<?>[] paramTypes = method.getParameterTypes();
        Class<?>   returnType = method.getReturnType();

        writeString(buffer, name);
        writeType(buffer, returnType);
        buffer.put((byte)paramTypes.length);
        for (Class<?> paramType : paramTypes)
            writeType(buffer, paramType);
    }
{@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