Objects.requireNonNull(clazz);
Objects.requireNonNull(buffer);
try {
T t = clazz.newInstance();
new TDeserializer(PROTOCOL_FACTORY).deserialize(t, buffer);
return t;
} catch (IllegalAccessException e) {
throw new CodingException("Failed to access constructor for target type.", e);
} catch (InstantiationException e) {
throw new CodingException("Failed to instantiate target type.", e);