@SuppressWarnings("unchecked")
    public static Object readClassAndObject(ByteBuffer buffer) throws IOException {
        SerializerRegistration reg = readClass(buffer);
        if (reg == NULL_CLASS) return null;
        if (reg == null) throw new SerializerException( "Class not found for buffer data." );
        return reg.getSerializer().readObject(buffer, reg.getType());
    }
Read the class and the object.

@param buffer Buffer to read from.
@return The Object that was read.
@throws IOException If serialization failed.
jme3-networking/src/main/java/com/jme3/network/serializing/Serializer.java