Scala Library
|
|
scala/io/Source.scala
]
object
Source
extends
AnyRefValue Summary | |
val
|
DefaultBufSize : Int |
Method Summary | |
def
|
fromBytes
(bytes : Array[Byte])(implicit codec : Codec) : Source
Create a
Source from array of bytes, decoding
the bytes according to codec. |
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, bufferSize : Int, reset : () => Source, close : () => Unit)(implicit codec : Codec) : Source
Reads data from
inputStream with a buffered reader,
using encoding in implicit parameter codec . |
def
|
fromIterable
(iterable : Iterable[Char]) : Source
Creates a
Source from an Iterable. |
def
|
fromPath
(name : java.lang.String)(implicit codec : Codec) : Source
creates Source from file with given name, setting
its description to filename.
|
def
|
fromRawBytes
(bytes : Array[Byte]) : Source
Create a
Source from array of bytes, assuming
one byte per character (ISO-8859-1 encoding.) |
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())(codec)
|
def
|
stdin
: Source
Creates a
Source from System.in. |
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 |
def
stdin : Source
Source
from System.in.Source
from an Iterable.iterable -
the IterableSource
instance.Source
instance from a single character.c -
...Source
instance.chars -
...
def
fromString(s : java.lang.String) : Source
s -
...Source
from array of bytes, decoding
the bytes according to codec.bytes -
...enc -
...Source
instance.Source
from array of bytes, assuming
one byte per character (ISO-8859-1 encoding.)
def
fromPath(name : java.lang.String)(implicit
codec : Codec) : Source
def
fromURI(uri : java.net.URI)(implicit
codec : Codec) : Source
Source
from file with given file: URI
def
fromURL(url : java.net.URL)(implicit
codec : Codec) : Source
def
fromFile(file : java.io.File, bufferSize : Int)(implicit
codec : Codec) : Source
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, bufferSize : Int, reset : () => Source, close : () => Unit)(implicit
codec : Codec) : Source
inputStream
with a buffered reader,
using encoding in implicit parameter codec
.inputStream -
the input stream from which to readbufferSize -
buffer size (defaults to Source.DefaultBufSize)reset -
a () => Source which resets the stream (if unset, reset() will throw an Exception)codec -
(implicit) a scala.io.Codec specifying behavior (defaults to Codec.default)
Scala Library
|
|