package io
A collection of I/O utility methods.
- Alphabetic
- By Inheritance
- io
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- def copy(in: InputStream, out: OutputStream, bufferSize: Int = 4096): Unit
Copies the input stream to the output stream.
Copies the input stream to the output stream.
- in
the input stream to read. The InputStream will be closed, unlike commons-io's version.
- out
the output stream to write
- bufferSize
the size of buffer to use for each read
- def readBytes(in: InputStream): Array[Byte]
- def using[A, B <: AutoCloseable](closeable: B)(f: (B) => A): A
Executes a block with a closeable resource, and closes it after the block runs
Executes a block with a closeable resource, and closes it after the block runs
- A
the return type of the block
- B
the closeable resource type
- closeable
the closeable resource
- f
the block
- def withTempFile[A](content: String, prefix: String = "scalatra", suffix: String = ".tmp", directory: Option[File] = None)(f: (File) => A): A
Creates a temp file, passes it to a block, and removes the temp file on the block's completion.
Creates a temp file, passes it to a block, and removes the temp file on the block's completion.
- A
the return type of the block
- content
The content of the file
- prefix
The prefix of the temp file; must be at least three characters long
- suffix
The suffix of the temp file
- directory
The directory of the temp file; a system dependent temp directory if None
- f
the block
- returns
the result of f
- def zeroCopy(in: FileInputStream, out: OutputStream): Unit
- object FileCharset