docs: public static <T extends TBase> T detectAndDeserialize(final byte[] bytes, final T thriftObj) throws TException
    {
      Preconditions.checkNotNull(thriftObj);
      try {
        final byte[] src = decodeB64IfNeeded(bytes);
        final TProtocolFactory protocolFactory = TProtocolUtil.guessProtocolFactory(src, null);
        Preconditions.checkNotNull(protocolFactory);
        if (protocolFactory instanceof TCompactProtocol.Factory) {
          DESERIALIZER_COMPACT.get().deserialize(thriftObj, src);
        } else if (protocolFactory instanceof TBinaryProtocol.Factory) {
          DESERIALIZER_BINARY.get().deserialize(thriftObj, src);
        } else {
          DESERIALIZER_JSON.get().deserialize(thriftObj, src);
        }
      }
      catch (final IllegalArgumentException e) {
        throw new TException(e);
      }
      return thriftObj;
    }