'What is equals of Gson.fromJson() in Kotlinx.serialization?

I want to move from Gson to kotlinx.serialization, what is equals of this to kotlinx.serialization ?

private fun parseError(response: Response<*>?) {
      val error = gsonConverter(response?.errorBody()?.charStream())
      // Entire code
      // ....

}

private fun gsonConverter(charStream: Reader?): ErrorResponse {
            return Gson().fromJson(
                charStream, ErrorResponse::class.java
            )
        }


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source