private Class<?> readType(ByteBuffer buffer) throws IOException{
        SerializerRegistration reg = Serializer.readClass(buffer);
        if (reg == null){
            // either "void" or unknown val
            short id = buffer.getShort(buffer.position()-2);
            if (id == 0){
                return void.class;
            } else{
                logger.log(Level.WARNING, "Undefined class ID: {0}", id);
                throw new IOException(); // prevents message from being serialized
            }
        }
        return reg.getType();
    }
{@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