Movatterモバイル変換


[0]ホーム

URL:


Scala 3
3.7.4
LearnInstallPlaygroundFind A LibraryCommunityBlog
Scala 3
LearnInstallPlaygroundFind A LibraryCommunityBlog
DocsAPI
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL
Scala 3/scala/scala.io/Source

Source

scala.io.Source
See theSource companion class
objectSource

This object provides convenience methods to create an iterable representation of a source file.

Attributes

Companion
class
Source
Source.scala
Graph
Supertypes
classObject
traitMatchable
classAny
Self type
Source.type

Members list

Value members

Concrete methods

defcreateBufferedSource(inputStream:InputStream,bufferSize:Int = ...,reset: ()=>Source = ...,close: ()=>Unit = ...)(implicitcodec:Codec):BufferedSource

Reads data from inputStream with a buffered reader, using the encoding in implicit parameter codec.

Reads data from inputStream with a buffered reader, using the encoding in implicit parameter codec.

Value parameters

bufferSize

buffer size (defaults to Source.DefaultBufSize)

close

a () => Unit method which closes the stream (if unset, close() will do nothing)

codec

(implicit) a scala.io.Codec specifying behavior (defaults to Codec.default)

inputStream

the input stream from which to read

reset

a () => Source which resets the stream (if unset, reset() will throw an Exception)

Attributes

Returns

the buffered source

Source
Source.scala
deffromBytes(bytes:Array[Byte])(implicitcodec:Codec):Source

Create aSource from array of bytes, decoding the bytes according to codec.

Create aSource from array of bytes, decoding the bytes according to codec.

Attributes

Returns

the createdSource instance.

Source
Source.scala

Attributes

Source
Source.scala

Creates a Source instance from a single character.

Creates a Source instance from a single character.

Attributes

Source
Source.scala

creates Source from array of characters, with empty description.

creates Source from array of characters, with empty description.

Attributes

Source
Source.scala
deffromFile(name:String)(implicitcodec:Codec):BufferedSource

creates Source from file with given name, setting its description to filename.

creates Source from file with given name, setting its description to filename.

Attributes

Source
Source.scala

creates Source from file with given name, using given encoding, setting its description to filename.

creates Source from file with given name, using given encoding, setting its description to filename.

Attributes

Source
Source.scala
deffromFile(uri:URI)(implicitcodec:Codec):BufferedSource

createssource from file with given fileURI.

createssource from file with given fileURI.

Attributes

Source
Source.scala

creates Source from file with given file: URI

creates Source from file with given file: URI

Attributes

Source
Source.scala
deffromFile(file:File)(implicitcodec:Codec):BufferedSource

creates Source from file, using default character encoding, setting its description to filename.

creates Source from file, using default character encoding, setting its description to filename.

Attributes

Source
Source.scala

same as fromFile(file, enc, Source.DefaultBufSize)

same as fromFile(file, enc, Source.DefaultBufSize)

Attributes

Source
Source.scala
deffromFile(file:File,enc:String,bufferSize:Int):BufferedSource

Attributes

Source
Source.scala
deffromFile(file:File,bufferSize:Int)(implicitcodec:Codec):BufferedSource

Creates Source fromfile, using given character encoding, setting its description to filename.

Creates Source fromfile, using given character encoding, setting its description to filename. Input is buffered in a buffer of sizebufferSize.

Attributes

Source
Source.scala

Attributes

Source
Source.scala

Creates a Source from an Iterable.

Creates a Source from an Iterable.

Value parameters

iterable

the Iterable

Attributes

Returns

the Source

Source
Source.scala
deffromResource(resource:String,classLoader:ClassLoader = ...)(implicitcodec:Codec):BufferedSource

Reads data from a classpath resource, using either a context classloader (default) or a passed one.

Reads data from a classpath resource, using either a context classloader (default) or a passed one.

Value parameters

classLoader

classloader to be used, or context classloader if not specified

resource

name of the resource to load from the classpath

Attributes

Returns

the buffered source

Source
Source.scala

creates Source from a String, with no description.

creates Source from a String, with no description.

Attributes

Source
Source.scala
deffromURI(uri:URI)(implicitcodec:Codec):BufferedSource

createsSource from file with given file: URI

createsSource from file with given file: URI

Attributes

Source
Source.scala

same as fromURL(new URL(s))(Codec(enc))

same as fromURL(new URL(s))(Codec(enc))

Attributes

Source
Source.scala
deffromURL(s:String)(implicitcodec:Codec):BufferedSource

same as fromURL(new URL(s))

same as fromURL(new URL(s))

Attributes

Source
Source.scala

same as fromInputStream(url.openStream())(Codec(enc))

same as fromInputStream(url.openStream())(Codec(enc))

Attributes

Source
Source.scala
deffromURL(url:URL)(implicitcodec:Codec):BufferedSource

same as fromInputStream(url.openStream())(codec)

same as fromInputStream(url.openStream())(codec)

Attributes

Source
Source.scala

Creates aSource from System.in.

Creates aSource from System.in.

Attributes

Source
Source.scala

Deprecated methods

Create aSource from array of bytes, assuming one byte per character (ISO-8859-1 encoding.)

Create aSource from array of bytes, assuming one byte per character (ISO-8859-1 encoding.)

Attributes

Deprecated
[Since version 2.13.9]Use `fromBytes` and specify an encoding
Source
Source.scala

Concrete fields

Attributes

Source
Source.scala
In this article
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL

[8]ページ先頭

©2009-2025 Movatter.jp