← 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
Supported and developed by JetBrains .
Kotlin™ is protected under the Kotlin Foundation
and licensed under the Apache 2 license .