scala.io

object Source

[source: scala/io/Source.scala]

object Source
extends AnyRef
This object provides convenience methods to create an iterable representation of a source file.
Author
Burak Emir, Paul Phillips
Version
1.0, 19/08/2004
Value Summary
val DefaultBufSize : Int
val NoReset : () => Source
Method Summary
def fromBytes (bytes : Array[Byte])(implicit codec : Codec) : Source
Create a Source from array of bytes, with empty description.
def fromChar (c : Char) : Source
Creates a Source instance from a single character.
def fromChars (chars : Array[Char]) : Source
creates Source from array of characters, with empty description.
def fromFile (file : java.io.File, bufferSize : Int)(implicit codec : Codec) : Source
Creates Source from file, using given character encoding, setting its description to filename. Input is buffered in a buffer of size bufferSize.
def fromInputStream (inputStream : java.io.InputStream)(implicit codec : Codec) : Source
same as BufferedSource.fromInputStream(is)
def fromIterable (iterable : Iterable[Char]) : Source
def fromPath (name : java.lang.String)(implicit codec : Codec) : Source
creates Source from file with given name, setting its description to filename.
def fromString (s : java.lang.String) : Source
creates Source from string, with empty description.
def fromURI (uri : java.net.URI)(implicit codec : Codec) : Source
creates Source from file with given file: URI
def fromURL (url : java.net.URL)(implicit codec : Codec) : Source
same as fromInputStream(url.openStream(), enc)
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Value Details
val DefaultBufSize : Int

val NoReset : () => Source

Method Details
def fromIterable(iterable : Iterable[Char]) : Source

def fromChar(c : Char) : Source
Creates a Source instance from a single character.
Parameters
c - ...
Returns
the create Source instance.

def fromChars(chars : Array[Char]) : Source
creates Source from array of characters, with empty description.
Parameters
chars - ...
Returns
...

def fromString(s : java.lang.String) : Source
creates Source from string, with empty description.
Parameters
s - ...
Returns
...

def fromBytes(bytes : Array[Byte])(implicit codec : Codec) : Source
Create a Source from array of bytes, with empty description.
Parameters
bytes - ...
enc - ...
Returns
the created Source instance.

def fromPath(name : java.lang.String)(implicit codec : Codec) : Source
creates Source from file with given name, setting its description to filename.

def fromURI(uri : java.net.URI)(implicit codec : Codec) : Source
creates Source from file with given file: URI

def fromFile(file : java.io.File, bufferSize : Int)(implicit codec : Codec) : Source
Creates Source from file, using given character encoding, setting its description to filename. Input is buffered in a buffer of size bufferSize.

def fromURL(url : java.net.URL)(implicit codec : Codec) : Source
same as fromInputStream(url.openStream(), enc)

def fromInputStream(inputStream : java.io.InputStream)(implicit codec : Codec) : Source
same as BufferedSource.fromInputStream(is)