IO

object IO

IO is a utility class for input/output operations.

Prominent among the operations provided are close operations that suppress the annoying checked Exceptions that Java's AutoCloseable.close operation throws for no earthly reason. The close(AutoCloseable) methods defined here silence these pointless exceptions. If you should encounter a bizarre case where a close operation should really throw an exception, then do not use the close methods defined herein.

Author

Todd L Smith

Functions

Link copied to clipboard
fun close(closeable: AutoCloseable)

Attempt to close the specified resource. Suppress any exception thrown by the underlying close operation.

Link copied to clipboard
fun closeIfNotNull(closeable: AutoCloseable?)

Attempt to close the specified resource, which is generously permitted to be null. Suppress any exception thrown by the underlying close operation.