v1.6.21
  • Solutions
    • Multiplatform Mobile
    • Multiplatform for other platforms
    • Server-side
    • Web frontend
    • Data science
    • Android
  • Docs
  • Community
  • Teach
  • Play
    • Playground
    • Hands-on
    • Examples
    • Koans
← Docs
kotlin-stdlib / kotlin.io.path / java.nio.file.Path / writeBytes

writeBytes

JVM
JRE7
1.5
fun Path.writeBytes(
    array: ByteArray,
    vararg options: OpenOption)

(source)

Writes an array of bytes to this file.

By default, the file will be overwritten if it already exists, but you can control this behavior with options.

Parameters

array - byte array to write into this file.

options - options to determine how the file is opened.

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