IO API for working with files and streams.
This class is intended to implement different file traversal methods. It allows to iterate through all files inside a given directory.
class FileTreeWalk : Sequence<File>
An enumeration to describe possible walk directions. There are two of them: beginning from parents, ending with children, and beginning from children, ending with parents. Both use depth-first search.
enum class FileWalkDirection
Enum that can be used to specify behaviour of the copyRecursively()
function in exceptional conditions.
enum class OnErrorAction
An exception class which is used when we have not enough access for some operation.
class AccessDeniedException : FileSystemException
An exception class which is used when some file to create or copy to already exists.
class FileAlreadyExistsException : FileSystemException
A base exception class for file system exceptions.
open class FileSystemException : IOException
An exception class which is used when file to copy does not exist.
class NoSuchFileException : FileSystemException
Returns the default buffer size when working with buffered streams.
const val DEFAULT_BUFFER_SIZE: Int
Creates a new byte input stream for the string.
fun String.byteInputStream( charset: Charset = Charsets.UTF_8 ): ByteArrayInputStream
Creates an input stream for reading data from this byte array.
fun ByteArray.inputStream(): ByteArrayInputStream
Creates an input stream for reading data from the specified portion of this byte array.
fun ByteArray.inputStream( offset: Int, length: Int ): ByteArrayInputStream
Prints the given message to the standard output stream.
fun print(message: Int)
fun print(message: Long)
fun print(message: Byte)
fun print(message: Short)
fun print(message: Char)
fun print(message: Boolean)
fun print(message: Float)
fun print(message: Double)
fun print(message: CharArray)
fun print(message: String)
fun print(message: Any?)
Prints the given message and the line separator to the standard output stream.
fun println(message: Int)
fun println(message: Long)
fun println(message: Byte)
fun println(message: Short)
fun println(message: Char)
fun println(message: Boolean)
fun println(message: Float)
fun println(message: Double)
fun println(message: CharArray)
fun println(message: String)
fun println(message: Any?)
Prints the line separator to the standard output stream.
fun println()
Creates a new reader for the string.
fun String.reader(): StringReader
Reads a line of input from the standard input stream.
fun readLine(): String?
© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.io/index.html