getAsInt

open fun getAsInt(key: String): Int?

Calls getNumber and cast to the desired type. This is different from the get#Type# methods as this will attempt to cast the value instead of returning 'null' if the tag is not the exact type (eg getByte returns null for a float, but getAsByte will cast)