IO API for working with files and streams.
class FileTreeWalk : Sequence<File> This class is intended to implement different file traversal methods. It allows to iterate through all files inside a given directory. | |
enum class FileWalkDirection 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 OnErrorAction Enum that can be used to specify behaviour of the |
class AccessDeniedException : FileSystemException An exception class which is used when we have not enough access for some operation. | |
class FileAlreadyExistsException : FileSystemException An exception class which is used when some file to create or copy to already exists. | |
open class FileSystemException : IOException A base exception class for file system exceptions. | |
class NoSuchFileException : FileSystemException An exception class which is used when file to copy does not exist. |
const val DEFAULT_BUFFER_SIZE: Int Returns the default buffer size when working with buffered streams. |
fun String.byteInputStream( charset: Charset = Charsets.UTF_8 ): ByteArrayInputStream Creates a new byte input stream for the string. | |
fun createTempDir( prefix: String = "tmp", suffix: String? = null, directory: File? = null ): File Creates an empty directory in the specified directory, using the given prefix and suffix to generate its name. | |
fun createTempFile( prefix: String = "tmp", suffix: String? = null, directory: File? = null ): File Creates a new empty file in the specified directory, using the given prefix and suffix to generate its name. | |
fun ByteArray.inputStream(): ByteArrayInputStream Creates an input stream for reading data from this byte array. fun ByteArray.inputStream( offset: Int, length: Int ): ByteArrayInputStream Creates an input stream for reading data from the specified portion of this byte array. | |
fun print(message: Any?) 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) Prints the given message to the standard output stream. | |
fun println(message: Any?) 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) Prints the given message and newline to the standard output stream. fun println() Prints a newline to the standard output stream. | |
fun readLine(): String? Reads a line of input from the standard input stream. | |
fun String.reader(): StringReader Creates a new reader for the string. | |
fun <T : Closeable?, R> T.use(block: (T) -> R): R Executes the given block function on this resource and then closes it down correctly whether an exception is thrown or not. |
© 2010–2018 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.io/index.html