Package

org.scalatra.util

io

Permalink

package io

A collection of I/O utility methods.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. io
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. object FileCharset

    Permalink
  2. def copy(in: InputStream, out: OutputStream, bufferSize: Int = 4096): Unit

    Permalink

    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

  3. def readBytes(in: InputStream): Array[Byte]

    Permalink
  4. def using[A, B <: AnyRef { def close(): Unit }](closeable: B)(f: (B) ⇒ A): A

    Permalink

    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

  5. def withTempFile[A](content: String, prefix: String = "scalatra", suffix: String = ".tmp", directory: Option[File] = None)(f: (File) ⇒ A): A

    Permalink

    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

  6. def zeroCopy(in: FileInputStream, out: OutputStream): Unit

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped