code: @SuppressWarnings("unchecked")
    private <T> T readById(int id, BufferInput<?> buffer) {
      Class<T> type = (Class<T>) registry.type(id);
      if (type == null)
        throw new SerializationException("cannot deserialize: unknown type");
  
      TypeSerializer<T> serializer = getSerializer(type);
      if (serializer == null)
        throw new SerializationException("cannot deserialize: unknown type");
  
      return serializer.read(type, buffer, this);
    }
docs: Reads a serializable object.
  
  @param id The serializable type ID.
  @param buffer The buffer from which to read the object.
  @param <T> The object type.
  @return The read object.