public static SerializerRegistration writeClass(ByteBuffer buffer, Class type) throws IOException {
        SerializerRegistration reg = getSerializerRegistration(type);
        if (reg == null) {
            throw new SerializerException( "Class not registered:" + type );
        }
        
        if( log.isLoggable(Level.FINER) ) {
            log.log(Level.FINER, "writing class:{0} with ID:{1}", new Object[]{type, reg.getId()});
        }
        buffer.putShort(reg.getId());
        return reg;
    }
Write a class and return its SerializerRegistration.

@param buffer The buffer to write the given class to.
@param type The class to write.
@return The SerializerRegistration that's registered to the class.
jme3-networking/src/main/java/com/jme3/network/serializing/Serializer.java