code: public static Object fromBytes(byte[] b, Class<?> clazz)
      {
  
          if (clazz.isAssignableFrom(String.class))
          {
              return Bytes.toString(b);
          }
          else if (clazz.equals(int.class) || clazz.isAssignableFrom(Integer.class))
          {
              return Bytes.toInt(b);
          }
          else if (clazz.equals(long.class) || clazz.isAssignableFrom(Long.class))
          {
              return Bytes.toLong(b);
          }
          else if (clazz.equals(boolean.class) || clazz.isAssignableFrom(Boolean.class))
          {
              return Bytes.toBoolean(b);
          }
          else if (clazz.equals(double.class) || clazz.isAssignableFrom(Double.class))
          {
              return Bytes.toDouble(b);
          }
          else if (clazz.equals(float.class) || clazz.isAssignableFrom(Float.class))
          {
              return Bytes.toFloat(b);
          }
          else if (clazz.equals(short.class) || clazz.isAssignableFrom(Short.class))
          {
              return Bytes.toShort(b);
          }
          else if (clazz.equals(BigDecimal.class))
          {
              return Bytes.toBigDecimal(b);
          }
          else
          {
              return PropertyAccessorFactory.getPropertyAccessor(clazz).fromBytes(clazz, b);
          }
      }
docs: From bytes.
  
  @param b
  the b
  @param clazz
  the clazz
  @return the object