Streamable

dotty.tools.io.Streamable
object Streamable

Traits for objects which can be represented as Streams.

Attributes

Authors:

Paul Phillips

Since

2.8 ''Note: This library is considered experimental and should not be used unless you know what you are doing.''

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Streamable.type

Members list

Type members

Classlikes

trait Bytes

Traits which can be viewed as a sequence of bytes. Source types which know their length should override def length: Long for more efficient method implementations.

Traits which can be viewed as a sequence of bytes. Source types which know their length should override def length: Long for more efficient method implementations.

''Note: This library is considered experimental and should not be used unless you know what you are doing.''

Note that this code was not written with resource management in mind. Several methods (such as chars and lines) create InputStreams they don't close

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Chars
class File
trait Chars extends Bytes

For objects which can be viewed as Chars.

For objects which can be viewed as Chars.

''Note: This library is considered experimental and should not be used unless you know what you are doing.''

Attributes

Supertypes
trait Bytes
class Object
trait Matchable
class Any
Known subtypes
class File

Value members

Concrete methods

def bytes(is: => InputStream): Array[Byte]
def closing[T <: Closeable, U](stream: T)(f: T => U): U

Call a function on something Closeable, finally closing it.

Call a function on something Closeable, finally closing it.

Attributes

def slurp(is: => InputStream)(implicit codec: Codec): String
def slurp(url: URL)(implicit codec: Codec): String