Streamable

object Streamable

Traits for objects which can be represented as Streams.

Authors

Paul Phillips

Since

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

class Object
trait Matchable
class Any

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

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.''

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.

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