|
Scala Library
|
|
scala/io/Source.scala]
object
Source
extends AnyRef| Value Summary | |
val
|
DefaultBufSize : Int |
val
|
NoReset : () => Source |
| Method Summary | |
def
|
fromBytes
(bytes : Array[Byte]) : Source
Creates a
Source instance from the given array of bytes,
with empty description. |
def
|
fromBytes
(bytes : Array[Byte], enc : java.lang.String) : Source
Creates Source from array of bytes with given encoding, 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) : Source
creates Source from file, using default character encoding, setting its
description to filename.
|
def
|
fromFile
(name : java.lang.String) : Source
creates Source from file with given name, setting its description to
filename.
|
def
|
fromFile
(name : java.lang.String, enc : java.lang.String) : Source
creates Source from file with given name, using given encoding, setting
its description to filename.
|
def
|
fromFile
(file : java.io.File, enc : java.lang.String) : Source
same as fromFile(file, enc, Source.DefaultBufSize)
|
def
|
fromFile
(file : java.io.File, enc : java.lang.String, bufferSize : Int) : Source
Creates Source from
file, using given character encoding,
setting its description to filename. Input is buffered in a buffer of
size bufferSize. |
def
|
fromFile
(uri : java.net.URI) : Source
creates
Source from file with given file: URI |
def
|
fromFile
(uri : java.net.URI, enc : java.lang.String) : Source
creates Source from file with given file: URI
|
def
|
fromInputStream
(is : java.io.InputStream, enc : java.lang.String) : Source
same as BufferedSource.fromInputStream(is, enc, Source.DefaultBufSize)
|
def
|
fromInputStream
(istream : java.io.InputStream, enc : java.lang.String, maxlen : Option[Int]) : Source
reads data from
istream into a byte array, and calls
fromBytes with given encoding enc.
If maxlen is given, reads not more bytes than maxlen;
if maxlen was not given, or was <= 0, then
whole istream is read and closed afterwards. |
def
|
fromInputStream
(is : java.io.InputStream) : Source
same as BufferedSource.fromInputStream(is, "utf-8", Source.DefaultBufSize)
|
def
|
fromString
(s : java.lang.String) : Source
creates Source from string, with empty description.
|
def
|
fromURL
(s : java.lang.String, enc : java.lang.String) : Source
same as fromURL(new URL(s), enc)
|
def
|
fromURL
(url : java.net.URL, enc : java.lang.String) : Source
same as fromInputStream(url.openStream(), enc)
|
def
|
fromURL (url : java.net.URL) : Source |
def
|
fromURL (s : java.lang.String) : 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 |
| Value Details |
| Method Details |
Source instance from the given array of bytes,
with empty description.bytes - ...Source instance.
def
fromBytes(bytes : Array[Byte], enc : java.lang.String) : Source
bytes - ...enc - ...Source instance from a single character.c - ...Source instance.chars - ...
def
fromString(s : java.lang.String) : Source
s - ...
def
fromFile(name : java.lang.String) : Source
def
fromFile(name : java.lang.String, enc : java.lang.String) : Source
def
fromFile(uri : java.net.URI) : Source
Source from file with given file: URI
def
fromFile(uri : java.net.URI, enc : java.lang.String) : Source
def
fromFile(file : java.io.File) : Source
def
fromFile(file : java.io.File, enc : java.lang.String) : Source
def
fromFile(file : java.io.File, enc : java.lang.String, bufferSize : Int) : Source
file, using given character encoding,
setting its description to filename. Input is buffered in a buffer of
size bufferSize.
def
fromURL(s : java.lang.String) : Source
s - ...
def
fromURL(s : java.lang.String, enc : java.lang.String) : Source
def
fromURL(url : java.net.URL) : Source
url - ...
def
fromURL(url : java.net.URL, enc : java.lang.String) : Source
def
fromInputStream(istream : java.io.InputStream, enc : java.lang.String, maxlen : Option[Int]) : Source
istream into a byte array, and calls
fromBytes with given encoding enc.
If maxlen is given, reads not more bytes than maxlen;
if maxlen was not given, or was <= 0, then
whole istream is read and closed afterwards.istream - the input stream from which to readenc - the encoding to apply to the bytesmaxlen - optionally, a positive int specifying maximum number of bytes to read
def
fromInputStream(is : java.io.InputStream, enc : java.lang.String) : Source
def
fromInputStream(is : java.io.InputStream) : Source
|
Scala Library
|
|