This object provides convenience methods to create an iterable representation of a source file.
| Supertypes | |
|---|---|
| Self type |
Reads data from inputStream with a buffered reader, using the encoding in implicit parameter codec.
| Value parameters |
|
|---|---|
| Returns | the buffered source |
Create a Source from array of bytes, decoding the bytes according to codec.
| Returns | the created |
|---|
Creates a Source instance from a single character.
creates Source from array of characters, with empty description.
creates Source from file with given name, setting its description to filename.
creates Source from file with given name, using given encoding, setting its description to filename.
creates source from file with given file URI.
creates Source from file with given file: URI
creates Source from file, using default character encoding, setting its description to filename.
same as fromFile(file, enc, Source.DefaultBufSize)
Creates Source from file, using given character encoding, setting its description to filename. Input is buffered in a buffer of size bufferSize.
Creates a Source from an Iterable.
| Value parameters |
|
|---|---|
| Returns | the Source |
Create a Source from array of bytes, assuming one byte per character (ISO-8859-1 encoding.)
Reads data from a classpath resource, using either a context classloader (default) or a passed one.
| Value parameters |
|
|---|---|
| Returns | the buffered source |
creates Source from a String, with no description.
creates Source from file with given file: URI
same as fromURL(new URL(s))(Codec(enc))
same as fromURL(new URL(s))
same as fromInputStream(url.openStream())(Codec(enc))
same as fromInputStream(url.openStream())(codec)
Creates a Source from System.in.
© 2002-2022 EPFL, with contributions from Lightbend.
Licensed under the Apache License, Version 2.0.
https://scala-lang.org/api/3.2.0/scala/io/Source$.html