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
Version
1.0, 19/08/2004
Method Summary
def fromBytes (bytes : Array[Byte], enc : String) : Source
Creates Source from array of bytes with given encoding, with empty description.
def fromBytes (bytes : Array[Byte]) : Source
Creates a Source instance from the given 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 (name : String, enc : String) : Source
creates Source from file with given name, using given encoding, setting its description to filename.
def fromFile (file : File, enc : String) : Source
Creates Source from file, using given character encoding, setting its description to filename.
def fromFile (name : String) : Source
creates Source from file with given name, setting its description to filename.
def fromFile (file : File) : Source
creates Source from file, using default character encoding, setting its description to filename.
def fromFile (uri : URI) : Source
creates Source from file with given file: URI
def fromInputStream (is : InputStream, enc : String) : Source
same as fromInputStream(is, enc, None)
def fromInputStream (istream : InputStream, enc : String, maxlen : Option[Int]) : Source
reads data from inputstream into a byte array, and calls fromBytes with given encoding. If maxlen is given, reads not more bytes than maxlen. if maxlen was not given, or was <= 0, then whole inputstream is read and closed afterwards.
def fromInputStream (is : InputStream) : Source
same as fromInputStream(is, "utf-8", None)
def fromString (s : String) : Source
creates Source from string, with empty description.
def fromURL (url : URL) : Source
def fromURL (s : String) : Source
def setFileDescriptor (file : File, s : Source) : Source
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf