scala.io

Source

object Source extends AnyRef

This object provides convenience methods to create an iterable representation of a source file.

Inherits

  1. AnyRef
  2. Any

Value Members

  1. val DefaultBufSize: Int

  2. def equals(arg0: Any): Boolean

    This method is used to compare the receiver object (this) with the argument object (arg0) for equivalence

  3. def fromBytes(bytes: Array[Byte])(codec: Codec): Source

    Create a Source from array of bytes, decoding the bytes according to codec

  4. def fromChar(c: Char): Source

    Creates a Source instance from a single character

  5. def fromChars(chars: Array[Char]): Source

    creates Source from array of characters, with empty description

  6. def fromFile(file: File, bufferSize: Int)(codec: Codec): Source

    Creates Source from file, using given character encoding, setting its description to filename

  7. def fromInputStream(inputStream: InputStream, bufferSize: Int, reset: () ⇒ Source, close: () ⇒ Unit)(codec: Codec): Source

    Reads data from inputStream with a buffered reader, using encoding in implicit parameter codec

  8. def fromIterable(iterable: Iterable[Char]): Source

    Creates a Source from an Iterable

  9. def fromPath(name: String)(codec: Codec): Source

    creates Source from file with given name, setting its description to filename

  10. def fromRawBytes(bytes: Array[Byte]): Source

    Create a Source from array of bytes, assuming one byte per character (ISO-8859-1 encoding

  11. def fromString(s: String): Source

    creates Source from string, with empty description

  12. def fromURI(uri: URI)(codec: Codec): Source

    creates Source from file with given file: URI

  13. def fromURL(url: URL)(codec: Codec): Source

    same as fromInputStream(url

  14. def hashCode(): Int

    Returns a hash code value for the object

  15. def stdin: Source

    Creates a Source from System

  16. def toString(): String

    Returns a string representation of the object