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

Extensions for java.net.URL

JVM
1.0

readBytes

Reads the entire content of the URL as byte array.

fun URL . readBytes ( ) : ByteArray
JVM
1.0

readText

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

fun URL . readText ( charset : Charset = Charsets.UTF_8 ) : String
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 .