← Docs
kotlin-stdlib / kotlin.io / java.net.URL / readText

readText

JVM
1.0
fun URL . readText ( charset : Charset = Charsets.UTF_8 ) : String
(source)

Reads the entire content of this URL as a String using UTF-8 or the specified charset .

This method is not recommended on huge files.

Parameters

charset - a character set to use.

Return a string with this URL entire content.

Stay in touch:
  • Contributing to Kotlin
  • Releases
  • Press Kit
  • Security
  • Blog
  • Issue Tracker
  • Brand assets
  • Careers
Supported and developed by JetBrains .
Kotlin™ is protected under the Kotlin Foundation
and licensed under the Apache 2 license .